From the course: Linux System Engineer: Advanced Disk Systems and System Backup

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Compress files

Compress files

- [Instructor] When we're using tar to create archives, it's easy to pass a compressor to make the archive smaller. However, these compressors can be used separately as well. We might want to use a compressor without tar if we just want to make a file smaller and we're not concerned with metadata like file ownership, permissions or timestamps. Note that some compressors don't work well with recursive directories so tar would be the best tool there. The first compressor we'll look at is gzip. As we saw in our previous video, to create a tar archive and call gzip, we just pass the dash dash gzip option to tar. To create a gzip archive without tar, we use it directly. Let's copy the Etsy services file to our current directory so we have something to compress. Type in cp /etc/services space dot and hit enter. The dot being a shortcut to our current directory. Now let's list that file, compress it using gzip, and then list it again. Type in clear. And then type in ls -lh and hit enter. Now…

Contents