Problem

In this hands-on project, you use common compression utilities to compress and uncompres...

In this hands-on project, you use common compression utilities to compress and uncompress information.

1. Turn on your computer. After your Linux system has been loaded, switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type cp /etc/services ~ and press Enter to make a copy of the /etc/services file in your current directory. Next, type ls –l at the command prompt and press Enter. How large is the services file?

3. At the command prompt, type compress5 -v services and press Enter to compress the services file. (The compress utility is not installed by default. You can install it by running the yum install ncompress command, as shown earlier in this chapter.) What was the compression ratio? Next, type ls –l at the command prompt and press Enter. What extension does the services file have and how large is it?

4. At the command prompt, type uncompress -v services.Z and press Enter to decompress the services file.

5. At the command prompt, type compress -vr Desktop and press Enter to compress the contents of the Desktop subdirectory. Next, type ls –lR Desktop at the command prompt and press Enter to view the contents of the Desktop directory. Which files were compressed? If there were symbolic links in this directory, how could you force the compress utility to compress these files as well?

6. At the command prompt, type uncompress -vr Desktop and press Enter to decompress the contents of the Desktop subdirectory. Next, type ls –lR Desktop at the command prompt and press Enter to verify that these files were uncompressed.

7. At the command prompt, type ps –ef | compress –v >psfile.Z and press Enter to compress the output of the ps –ef command to a file called psfile.Z. What was the compression ratio?

8. At the command prompt, type zmore psfile.Z and press Enter to view the compressed contents of the psfile.Z file. When finished, press q to quit the zmore utility.

9. At the command prompt, type gzip -v services and press Enter to compress the services file. What was the compression ratio? How does this ratio compare with the one obtained in Step 3? Why? Next, type ls –l at the command prompt and press Enter. What extension does the services file have and how large is it?

10. At the command prompt, type gunzip -v services.gz and press Enter to decompress the services file.

11. At the command prompt, type gzip -v -9 services and press Enter to compress the services file. What was the compression ratio? Why?

12. At the command prompt, type gunzip -v services.gz and press Enter to decompress the services file.

13. At the command prompt, type gzip -v -1 services and press Enter to compress the services file. What was the compression ratio? Why?

14. At the command prompt, type gunzip -v services.gz and press Enter to decompress the services file.

15. At the command prompt, type bzip2 -v services and press Enter to compress the services file. What was the compression ratio? How does this compare with the ratios from Step 3 and Step 9? Why? Next, type ls –l at the command prompt and press Enter. What extension does the services file have and how large is it?

16. At the command prompt, type bunzip2 -v services.bz2 and press Enter to decompress the services file.

17. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 11