Marketplace:

 
Domain registration: Buy domain name with free domain hosting features
Cheap domain hosting for ecommerce and small business
-

 

   

Next: Finding Files Up: More on Files Previous: Files Present and Their   Contents   Index

File Compression with gzip

Often it would be nice to make a file smaller - say, to download it faster, or so it takes up less space on your disk. The program to do this is called gzip (GNU zip). Here's how it works:

cd; cp /etc/profile ./mysamplefile

This switches to your home directory and copies an arbitrarily chosen file (/etc/profile) to your current directory, in the process renaming it mysamplefile. This gives you a file to play with when using gzip.

ls -l

Lists the contents of the current directory. Note the size of mysamplefile.

gzip mysamplefile

Compresses mysamplefile.

ls -l

Observe the results of this command: mysamplefile is now called mysamplefile.gz . It's also a good bit smaller.

gunzip mysamplefile.gz; ls -l

This uncompresses the file. Observe that mysamplefile has returned to its original state. Notice that to uncompress, one uses gunzip, not gzip.

rm mysamplefile

Use this command to remove the file, since it was just to practice with.


next up previous contents index
Next: Finding Files Up: More on Files Previous: Files Present and Their   Contents   Index

John Goerzen / Ossama Othman

 

      

Marketplace:
Facts: " Large increases in cost with questionable increases in performance can be tolerated only in race horses and women.   "  

Wednesday 20 August 2008 17:25:52 1219253152