Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

small tip - How to tar.gz files

Date: 2009-03-15 00:00:00 -0400

If you need to tar a directory and compress it with gzip to backup or just to translate the files you can do it in one single command.

Enter this:

tar czf /path/to/tar.gz_file /path/to/directory/to/be/tar.gz

In the next example I will add the files in

/home/me/docs

to a tar file named mydocs.tar.gz

tar czf /tmp/mydocs.tar.gz /home/me/docs/

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.