Linux Tutorials - Herong's Tutorial Examples - v5.45, by Herong Yang
"compress/uncompress" - Compressed *.Z Files
This section provides a tutorial example on how to use 'compress' and 'uncompress' commands to compress large files and restore them later. Compressed files will have the *.Z file name extension.
If you have a large file, you may want to compress it with the "compress" utility to save storage space.
1. Compress a file with the "compress" command, which uses the adaptive Lempel-Ziv algorithm. The original file is replaced with the compressed version and renamed to the same name plus the extension .Z.
herong$ cp history-of-linux.txt history-of-linux-bck.txt herong$ compress history-of-linux.txt herong$ ls -l history* -rw-r--r-- 1 herong staff 1444 history-of-linux-bck.txt -rw-r--r-- 1 herong staff 963 history-of-linux.txt.Z
2. Restore a compressed file with the "uncompress" command. The compressed file is replaced with the restored version and renamed to the same name without the extension .Z.
herong$ uncompress history-of-linux.txt.Z herong$ ls -l history* -rw-r--r-- 1 herong staff 1444 history-of-linux-bck.txt -rw-r--r-- 1 herong staff 1444 history-of-linux.txt
Table of Contents
Cockpit - Web Portal for Administrator
"more", "head" and "cat" - Read Files
"split" and "cat" - Split and Join Files
►"compress/uncompress" - Compressed *.Z Files
"gzip/gunzip" - Compressed *.gz Files
"xz/unxz" - Compressed *.xz or *.lzma Files
"tar -c" and "tar -x" - Create and Extract Archive Files
"zip" and "unzip" - Create and Extract ZIP Files
"Operation not permitted" Error on macOS
SELinux - Security-Enhanced Linux
SSH Protocol and ssh/scp Commands
Software Package Manager on CentOS - DNF and YUM
vsftpd - Very Secure FTP Daemon