Introduction
These are tar commands that I use often but need help remembering.
Contents
Create an archive
tar -cvf send.tar send/
| |
---|
-c | Create an archive |
-v | Verbose |
-f | Specify filename |
Create a gzip compressed archive
tar -czvf send.tar.gz send/
| |
---|
-c | Create an archive |
-z | Compress archive with gzip |
-v | Verbose |
-f | Specify filename |
tar -xvf send.tar
| |
---|
-x | Extract an archive |
-v | Verbose |
-f | Specify filename |
tar -xvzf send.tar
| |
---|
-x | Extract an archive |
-v | Verbose |
-z | Decompress using gzip |
-f | Specify filename |
List files in an archive
tar -tvf send.tar
| |
---|
-t | List contents |
-v | Verbose |
-f | Specify filename |
List files in a compressed archive
tar -tzvf send.tar.gz
| |
---|
-t | List contents |
-z | Decompress using gzip |
-v | Verbose |
-f | Specify filename |
tar -xvf send.tar my_taxes.xlsx scan.pdf
| |
---|
-x | Extract an archive |
-v | Verbose |
-f | Specify filename |
:)