Archiving and Backup related commands
Decompress a file called 'file1.bz2'
# bunzip2 file1.bz2
Compress a file called 'file1'
# bzip2 file1
Decompress a file called 'file1.gz'
# gunzip file1.gz
Compress a file called 'file1'
# gzip file1
Compress with maximum compression
# gzip -9 file1
Create an archive rar called 'file1.rar'
# rar a file1.rar test_file
Compress 'file1', 'file2' and 'dir1' simultaneously
# rar a file1.rar file1 file2 dir1
Decompress rar archive
# rar x file1.rar
Create a uncompressed tarball
# tar -cvf archive.tar file1
Create an archive containing 'file1', 'file2' and 'dir1'
# tar -cvf archive.tar file1 file2 dir1
Show contents of an archive
# tar -tf archive.tar
Extract a tarball
# tar -xvf archive.tar
Extract a tarball into / tmp
# tar -xvf archive.tar -C /tmp
Create a tarball compressed into bzip2
# tar -cvfj archive.tar.bz2 dir1
Decompress a compressed tar archive in bzip2
# tar -xvfj archive.tar.bz2
Create a tarball compressed into gzip
# tar -cvfz archive.tar.gz dir1
Decompress a compressed tar archive in gzip
# tar -xvfz archive.tar.gz
Decompress rar archive
# unrar x file1.rar
Decompress a zip archive
# unzip file1.zip
Create an archive compressed in zip
# zip file1.zip file1
Compress in zip several files and directories simultaneously
# zip -r file1.zip file1 file2 dir1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment