Commands.app

tar

File Management

Archive files and directories

Options & Flags
Available options for this command
-c

Create a new archive

-x

Extract files from archive

-v

Verbose mode, show files being processed

-f file

Specify archive filename

-z

Compress with gzip (.tar.gz)

Examples
Common usage examples

Create compressed archive

tar -czf archive.tar.gz /path/to/directory

Extract compressed archive

tar -xzf archive.tar.gz

List contents without extracting

tar -tzf archive.tar.gz
Notes
  • Common pattern: -czf (create), -xzf (extract), -tzf (list)
  • Use -j for bzip2 compression instead of -z
Related Commands
You might also find these useful