Uncompressing files with uncompress

Compressing a file is handy for reducing the amount of disk space it uses, but you can't do much with a compressed file—directly, at least. You'll need to uncompress it first. As Code Listing 13.9 shows, you do so using the uncompress command.

To uncompress a file with uncompress:

  • uncompress labrea.tar.Z

    At the shell prompt, type uncompress followed by the full file name of the file to uncompress. The compressed file is replaced by the uncompressed file, which is named like the original, but without the .Z (see Code Listing 13.9).

Tip

Remember that uncompressed files take up more space—sometimes lots more space—than compressed files. You might want to check your storage quota with your ISP before you uncompress a file to make sure that you don't exceed your limit. As Chapter 7 explains, you can check your quota by typing quota -v at the shell prompt.


Tip

You can add the -c flag to uncompress to leave the original file untouched and send the uncompressed version to standard output. For example, you might use uncompress -c tarred.tar.Z > tarred.tar. See Chapter 1 for more information on redirecting output, as is shown here.


Tip

You can also use gunzip to uncompress compressed files. Check out Unzipping zipped files with gunzip later in this chapter.


Code Listing 13.9. You can uncompress files with a single swift command, and possibly double your disk usage at the same time, as shown here.
[ejr@hobbes compression]$ ls -l l*
-rw-r--r--   1 ejr      users      297027 Jul 27 10:06 labrea.tar.Z
[ejr@hobbes compression]$ uncompress labrea.tar.Z
[ejr@hobbes compression]$ ls -l l*
-rw-r--r--   1 ejr      users      501760 Jul 27 10:06 labrea.tar
[ejr@hobbes compression]$

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.241.228