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.

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]$ uncompresslabrea.tar.Z
[ejr@hobbes compression]$ ls -l l*
-rw-r-r-1 ejr   users   501760 Jul 27
→ 10:06 labrea.tar
[ejr@hobbes compression]$

To Uncompress a File with uncompress:

  • uncompress labrea.tar.Z

    At the shell prompt, type uncompress followed by the full filename 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).

✓ Tips

  • Remember that uncompressed files take up more space—sometimes a lot 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 often check your quota by typing quota -v at the shell prompt.

  • 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.

  • You can also use gunzip to uncompress compressed files. Check out Unzipping a gzip File with gunzip later in this chapter.


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

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