Uncompressing Files with uncompress

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 filedirectly, 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]$ 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]$ 

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


  • Remember that uncompressed files take up more spacesometimes a lot more spacethan 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.

Unix(c) Visual Quickstart Guide
UNIX, Third Edition
ISBN: 0321442458
EAN: 2147483647
Year: 2006
Pages: 251

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net