File Compression Commands
Edit me
File Compression
tar zcvf archive.tar.gz files...– create a gzip-compressed archivetar zxvf archive.tar.gz– decompress and extract archived files to current directorygzip file.txt– compresses a file (creates file.txt.gz) and removes the original, uncompressed versiongunzip file.txt.gz– uncompresses a file that was compressed withgziporcompressand removes the compressed versionzip -r archive.zip files...– create a zip archiveunzip archive.zip [-d destination_folder]– extract/decompress zip achiveunzip -l archive.zip– list the contents of archive.zip- zcat, zless, zmore, zgrep, zdiff – these ‘Z’ commands operate on gzip-compressed files and provide a ‘Z’ equivalent to their regular counterparts
zcat system.log.0.gz– view a compressed filezcatis identical togunzip -c
zless system.log.0.gz– ‘Z’ equivalent of less to view a compressed file