Wednesday, 22 June 2011

Archiving and extracting tar files

Create tar.gz file:
tar -czf /path/to/output/folder/filename.tar.gz/path/to/folder
Extract tar.gz to folder:
tar -xvzf /path/to/output/folder/filename.tar.gz -C /path/to/folder
List the contents of a tar.gz file:
tar -ztvf file.tar.gz

c: create
x: extract
t: List the contents of an archive
v: Verbosely list files processed (display detailed information)
z: Filter the archive through gzip so that we can open compressed (decompress) .gz tar file
j: Filter archive through bzip2, use to decompress .bz2 files.
f filename: Use archive file called filename

Possibly Related Posts

No comments:

Post a Comment