tar
Windows CMD · Files · reference only
What it does
Creates and extracts archives (.tar, .tar.gz, .zip). It ships with Windows 10 and 11, based on bsdtar.
Syntax
tar [opciones] [fichero...]
Options and parameters
-cCreates a new archive.
-xExtracts the content of an archive.
-tLists the content without extracting it.
-f archivoName of the archive being worked with.
-zCompresses or decompresses with gzip.
-vShows files as they are processed.
-C directorioChanges to that directory before extracting or creating.
-aChooses the compression format from the extension, including zip.
Usage examples
tar -cvf copia.tar carpetaPacks a folder into copia.tar without compressing.
tar -czf copia.tar.gz carpetaPacks and compresses with gzip.
tar -xvf copia.tar -C destinoExtracts the archive into the destino folder.
tar -a -cf copia.zip carpetaCreates a zip file from a folder.
Notes and common mistakes
- When extracting, files that already exist are overwritten without asking.
- The -C destination folder must exist.