Now here's a command we've probably heard of a million and one times,
less is more.
And it is true.
We're able to use the less command to be able to page through our archives.
But not only that,
we don't have to worry about the compression that was used to
create the file; that's automatically detected.
And here we are, the glorious command line of AlmaLinux 8,
and we can begin by going through and looking inside of our archives.
So we saw before that using the ‑t or ‑‑verify,
we can go through and take a look inside of our archive file.
So of course, that could be the etc.tar file,
but equally, we can go through and say put our .gz file.
I don't need to specify the ‑z for the compression that was used.
As I go through and take a look at it, we get to see our content,
but of course, those contents scroll off the screen.
Now the idea of not putting in the switch for the compression comes
from the fact that if I interrogate the file,
so the file command itself will tell me what type of file something is,
Esc + dot will bring up my last argument,
and we can see this is gzipped compressed data.
So we know what type of compression was used by looking at the header.
Now we can also go through and use the command less.
Remember that less is more, and then we go through,
again, Esc + dot,
we can then page through each one of our pages relating to the
archive. And I can page up, and I can page down to see the content
of the file and just quit when I'm finished.
So it's really, really useful that we can then go through and
properly look in the file to see everything is there.
We're also seeing a little bit more metadata.
If I go back and, let's say, look at putting in a verbose
switch, and again, just to prove it,
we can go through and use the xz file. As we hit the big Enter key,
we can now see that file system metadata that was always in the file,
just doesn't show by default with tar, but by implementing the ‑v for
verbose option along with our tar command,
we can then automatically display that information on the screen.
So just giving you an idea of some of the tools that we
can use to look inside of our archives.
So we can use the less command or we can use the tar ‑verify command, ‑‑verify.
But we don't need to specify the compression that's being used because that's stored in the header of the file.