Tar: Difference between revisions

From Wiki
Jump to navigation Jump to search
New page: 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 develop...
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
go to [[Main Page]], [[Computational Resources]], [[Information & Help]], [[Linux & Unix]]
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.
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
* 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

Latest revision as of 11:49, 4 August 2009

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