What does tar -xzvf mean?
x extracts, z uses gzip, v prints each file name, and f says the next word is the archive file. On extract the z is optional, because tar detects the compression itself.
The cryptic flags, in plain English.
Paste a tar command and read what every flag does, with warnings for the mistakes that bite: -C in the wrong place, an archive accidentally named "v", excludes that exclude nothing, and extractions that overwrite. Or tick what you want and copy a command that is right the first time.
Loading the toolbox.
You do not have to take our word that your data stays here. Developer tools show every request a page makes, so you can watch this page work and confirm that nothing is sent. The check takes under a minute.
F12, or Cmd+Option+I on a Mac, and select the Network tab.Only two things can add a line to that log, and neither carries your data. Submitting the feedback form sends the vote and comment you typed. Typing characters in a script the page has not displayed yet, such as Cyrillic or Greek, can make the browser fetch the matching font file, and that request names only the font.
The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint, so a coding mistake could not quietly send your data elsewhere.
tar dates from the days of tape drives, and its options show it. Single letters are bundled together, so -xzvf is four options. The oldest form drops the dash entirely, as in tar xzvf. Some letters take a value and some do not, and a few options change meaning depending on where they appear on the line. Two different programs also answer to the name: GNU tar on most Linux systems, and bsdtar from libarchive on macOS, the BSDs, and Windows 10 and later.
This page reads a command the way tar does and writes out each part in plain English, so you can see what a command from a tutorial, a README, or your shell history will really do before you run it.
The -C option changes directory, but only for the file names that come after it. When you create an archive, tar -czf site.tar.gz -C /var/www html reads html from /var/www and stores it as html/. Move -C to the end, as in tar -czf site.tar.gz html -C /var/www, and tar reads html from the current folder instead, and the -C changes nothing. GNU tar prints a warning about options used after the file names, but the archive is still written, often with the wrong contents.
The same rule applies to --exclude in GNU tar 1.29 and later: an exclude placed after the paths applies to nothing, so the node_modules folder you meant to skip ends up in the archive. bsdtar applies excludes wherever they appear, which is why a command can work on a Mac and fail on a Linux server. The decoder flags both cases and tells you where to move the option.
tar -cfv backup.tar dir, the f takes the rest of its bundle as the archive name, so the archive is called v and backup.tar is added to it. Put f last, as in -cvf.-z with a file named .tar.bz2 makes a gzip file with the wrong extension. The -a option picks the compressor from the name for you.-z and -j together are an error.--transform or --remove-files that bsdtar on macOS does not have.--wildcards, and an unquoted pattern is expanded by your shell first.Most tar commands only read files, but a few can destroy data, and the decoder marks them in red:
--remove-files deletes each source file after adding it to the archive. If the archive is damaged, the files are gone.--overwrite and -U replace existing files on disk without asking.-P keeps absolute paths, so extracting can write anywhere, including system folders.-C / on extract unpacks everything relative to the filesystem root.--delete rewrites an archive in place and removes members permanently.Plain extraction also replaces existing files with the same names, which surprises many people. Add -k to keep existing files or --keep-newer-files to keep files that are newer than the archive copy.
tar -tvf archive.tar.gz and check that everything sits under one top-level folder, with no absolute paths and no ../ paths.mkdir -p restore, because -C does not create its target.tar -xf archive.tar.gz -C restore. No -z is needed: both GNU tar and bsdtar detect gzip, bzip2, xz, and zstd when reading a file.--strip-components=1 when you want the contents of the top-level folder without the folder itself.An archive that spills dozens of files into the current folder is called a tarbomb, and listing first is the simple defense. Avoid extracting archives from strangers with sudo, because as root tar restores the owners and permissions stored in the archive.
Choose whether you want to create an archive, extract one, or list its contents, then tick what you need: compression, verbose output, a folder to read from or extract into, exclude patterns, stripped folders, and whether to keep existing files. The builder writes the flags in a safe order: the f letter last in its bundle, excludes before the paths, and -C before the names it should apply to. Every part of the result is explained, and any part can be sent back to the decoder with one click.
Changing the compression also updates the file extension, so a gzip archive ends in .tar.gz and a zstd archive ends in .tar.zst. zstd uses the long option --zstd, which needs GNU tar 1.31 or later, or bsdtar 3.3 or later.
The recipe panel covers the jobs people search for most often: create a .tar.gz of a folder, list an archive, extract into a folder, extract a single file, drop the top-level folder, exclude node_modules and log files, archive a folder without its parent path, make the smallest archive with xz, use zstd, copy a folder over SSH with a tar pipe, archive files from a find list, and build a reproducible archive with GNU tar. Each recipe opens in the decoder, so you can see why it works before copying it. Other command builders sit in the same lane, such as ffmpeg for video and audio and Git commands for undoing mistakes.
Elsewhere in the toolbox: UUID, .gitignore, CSP, .htaccess, and more on the 2toolbox home page. Part of the 2suite.io privacy-first ecosystem.
x extracts, z uses gzip, v prints each file name, and f says the next word is the archive file. On extract the z is optional, because tar detects the compression itself.
When creating an archive, -C only applies to file names that come after it. Put -C and its folder before the names you want read from that folder.
In a bundle such as -cfv, the f takes the rest of the bundle as the archive name. Put f last, as in -cvf, so the next word is used as the name.
No. macOS ships bsdtar from libarchive and most Linux systems ship GNU tar. Common flags match, but some options, such as --transform, --remove-files, and --wildcards, exist only in GNU tar.
No. The command is only parsed in your browser and never run or sent anywhere. Copy it and run it in your own terminal.