Create an Archive

$ tar -cvf mydocs.tar mydocs/
$ gzip mydocs.tar

or in one step…

$ tar -zcvf mydocs.tgz mydocs/

Extract an Archive

$ tar -zxvf mydocs.tar.gz

Add to an Archive

$ tar -rvf mydocs.tar mydocs/some-folder
$ tar -rvf mydocs.tar mydocs/some-file.txt

List the Contents of an Archive

$ tar -tf mydocs.tar

Encrypt an Archive

gpg -c -o mydocs.tgz.gpg mydocs.tgz

Decrypt an Archive

gpg mydocs.tgz.gpg
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *