tar
Linux · Files · available in the simulator
What it does
Archive files and directories. When combined with -z (gzip) or -j (bzip2), it also compresses.
Syntax
tar [opciones] [archivo.tar] [archivos...]
Options and parameters
-cCreate a new archive.
tar -czvf copia.tar.gz carpeta/-xExtract files from an archive.
tar -xzvf copia.tar.gz-tList the contents of an archive.
-vVerbosely list files processed.
-fUse archive file; must immediately precede the archive name.
-zFilter the archive through gzip.
-jFilter the archive through bzip2.
-JFilter the archive through xz.
-CChange to directory before performing operations.
tar -xzf copia.tar.gz -C /tmp--excludeExclude files matching pattern.
Usage examples
tar -cvf fichero.tar carpetatar -tvf fichero.tartar -xvf fichero.tartar -zcvf fichero.tar.gz carpetatar -jcvf fichero.tar.bz2 carpetatar -czf backup.tar.gz carpeta/tar -xzf backup.tar.gztar -czvf copia.tar.gz carpeta/tar -xzvf copia.tar.gztar -xzf copia.tar.gz -C /tmp