Author | John Gilmore (all…) |
Contributor(s) | (all…) |
Released | gnu-2000 |
Source | gnu-tar.git |
Man | gnu-tar.1 |
openbsd-tar.1 | |
freebsd-tar.1 | |
Homepage | gnu-tar.web |
---|
GNU tar
saves many files together into a single tape or disk archive, and can
restore individual files from the archive. It includes multivolume support, the
ability to archive sparse files, automatic archive compression/decompression,
remote archives and special features that allow tar
to be used for incremental
and full backups. This distribution also includes rmt
, the remote tape server.
The mt
tape drive control program is in the GNU cpio
distribution.
OPT | TYPE | ++V | --V | DESC |
---|---|---|---|---|
--remove-files | Remove files from disk after adding them to the archive | |||
creat a tarball of current working directory:
~$ tar -cvzf "../${PWD##*/}.tar.gz" ./
extart *.tar.gz, *.tar.bz2 files:
~$ tar -xzvf tarball_file.tar.gz ~$ tar -xjvf tarball_file.tar.bz2
copy via tar pipe while preserving file permissions:
~$ tar -C source_path -cpf - . | tar -C target_path -xf -
maximized compression with xz archiver:
~$ XZ_OPT=-9e tar cJf tarfile.tar.xz directory ~$ tar -cf - directory/ | xz -9 -c - > tarfie.tar.xz
xz
pack all files within current directory with further their clean up:
~$ tar --create --verbose --remove-files --file tarfile.tar file1 file2 file3 ... fileN ~$ tar -cvf tarfile.tar file1 file2 file3 ... fileN --remove-files