Compress/Decompress Files in Linux
Tar and Gzip are two utilities that are very good at compressing one or multiple files into a smaller, single file.
Syntax to Compress
$ tar -cvf - /home | gzip -c > /backups/filedump.tar.gzThis will take the entire /home directory (and all subdirectories) and compress it to /backups/filedump.tar.gz. You can compress just a single file in the same way.
Syntax to Decompress
$ tar xvfz filedump.tar.gzThis decompresses anything in the filedump.tar.gz file.