tar
File ManagementArchive files and directories
Options & Flags
Available options for this command
-cCreate a new archive
-xExtract files from archive
-vVerbose mode, show files being processed
-f fileSpecify archive filename
-zCompress with gzip (.tar.gz)
Examples
Common usage examples
Create compressed archive
tar -czf archive.tar.gz /path/to/directoryExtract compressed archive
tar -xzf archive.tar.gzList contents without extracting
tar -tzf archive.tar.gzNotes
- Common pattern: -czf (create), -xzf (extract), -tzf (list)
- Use -j for bzip2 compression instead of -z
Related Commands
You might also find these useful