Compressing File Archives
Compressing File Archives
This command will create an archive archive.tar and put the file1 and file2 inside
of it. c option creates the archive. v option is describing what is happening, in
this case it lists the files that need to be archived. It is not really useful in this
situation, but imagine if you are archiving a lot of file which follow some
specific pattern.
Then you would like to know which exact files are being compressed. f option
is there so we can provide the name of the archive.
Put x instead of c and you will extract files from the archive. t option will list the
files inside of an archive.
These archives can also be compressed with gzip or bzip2. To operate on them
with gzip always add the z option. This option needs to be added when you
want to list gzip archives and also when you want to extract files from it.
Same goes for the bzip2 with the j option.