| Command | Explanation |
|---|---|
| -z | unzip |
| -x | extract file |
| -v | verbose |
| -f | Force |
| -t | table of contents |
tar -cvzf filename.tar.gz directoryORfileToCompress
tar -cvzf filename.$(date +"%Y-%m-%d").tar.gz directoryORfileToCompress
The following command can be used to view the contents of an archive. You can then decide if you wish to strip a component when uncompressing
tar tvf filename.tar.gz
tar -xzvf filename.tar.gz