June 2017
Intermediate to advanced
258 pages
6h 9m
English
tar is one of the most useful tools that come installed by default in most Linux distributions. There is a lot of power in tar; however, it can have a little bit of a learning curve with the wide number of switches you can use with it.
To compress a file using tar, I tend to use the following command:
tar –zcvf <newfilename.tar.gz> <filetobecompressed>
-z will compress the resulting tar file even further using gzip. -v turns on verbosity so that I can see what is going on. The -c flag will compress the file, and finally, the -f switch will inform tar that I will be specifying the file to be compressed. Here is a working example of using tar to compress:
To decompress the file, it's a very similar setup, just one change ...
Read now
Unlock full access