tar do?archive utility — bundle files into (or extract them from) a .tar.
▸ Explain your own tar command →$ tar -xzvf archive.tar.gz
$ tar czf backup.tgz src
| -c | create a new archive |
| -x | extract files from an archive |
| -t | list the contents of an archive |
| -r | append files to the end of an archive |
| -u | append only files newer than the archive copy |
| -z | filter the archive through gzip (.gz) |
| -j | filter the archive through bzip2 (.bz2) |
| -J | filter the archive through xz (.xz) |
| -v | verbose — list each file as it is processed |
| -f | use the next argument as the archive file name |
| -C | change to the given directory first |
| -p | preserve file permissions when extracting |
| -h | follow symlinks — archive the files they point to |
| -k | keep existing files; don't overwrite when extracting |
| --create | create a new archive |
| --extract | extract files from an archive |
| --list | list the contents of an archive |
| --gzip | filter the archive through gzip |
| --bzip2 | filter the archive through bzip2 |
| --xz | filter the archive through xz |
| --verbose | verbose — list each file as it is processed |
| --file | use the given archive file |
| --exclude | skip files matching this pattern |
| --exclude-from | skip files matching patterns read from this file |
| --exclude-vcs | skip version-control dirs (.git, .svn, …) |
| --strip-components | strip this many leading path parts when extracting |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.