Tar

From Wiki
Jump to navigation Jump to search

go to Main Page, Computational Resources, Information & Help, Linux & Unix


tar is both a file format and the name of a program used to handle such files. Initially developed to be written directly to sequential I/O devices for tape backup purposes, it is now commonly used to collect many files into one larger file, for distribution or archiving, while preserving file system information such as user and group permissions, dates, and directory structures.

  • To create a tar: tar -cvf file.tar file1 file2 file3

That will create a tar called file.tar containing in a single file the files: file1 file2 file3 The command tar -cvzf file.tar.gz file1 file2 file3, will create the file file.tar.gz, that is the same tar as above file.tar with the three files, but it will compress it with gzip.

  • To get the files from a tar: tar -xvf file.tar

This will unpack the file, and the files contained in it will be extracted. For compressed .tar.gz files: tar -xzvf files.tar.gz should be used, for .tarz: tar xfvz file.tarz file