Translations:Tar/7/en

From Alliance Doc
Jump to navigation Jump to search

Common tar options

These are the most common options for tar command. There are two synonymous forms for each, a single-letter form prefixed with a single dash, and a whole-word form prefixed with a double dash:

  • -c or --create: Create a new archive.
  • -f or --file=: Following is the archive file name.
  • -x or --extract: Extract files from archive.
  • -t or --list: List the contents of an archive file.
  • -J or --xz: Compress or uncompress with xz.
  • -z or --gzip: Compress or uncompress with gzip.

Single-letter options can be combined with a single dash, so for example

Question.png
[name@server ~]$ tar -cJf project1.tar.zx project1

is equivalent to

Question.png
[name@server ~]$ tar --create --xz --file=project1.tar.xz project1