w w w . T H E B I T S . c o . u k


How Do I Zip And Unzip Stuff?

Home Contents Previous Next

First Setup A Test Directory

- i -

Enter:

cd ~

...to go to your home directory (e.g. '/home/laurence').

- ii -

Enter:

mkdir Test.d

...to create the test directory you're going to work with.

- iii -

Enter:

cd Test.d

...to move into this newly created directory.

- iv -

Enter:

pico example1.txt

...enter some text into this text file, save it and exit Pico.

Now create 'example2.txt' and 'example3.txt' text files in the same manner and save them to the same directory.


Now Let's Make Our First Zip File!

- 1 -

Enter:

tar cvf backup.tar .

...to group the contents of the directory into the one file called 'backup.tar'.

- 2 -

For effect, let's now delete all those text files!

Enter:

rm e*

...and press the 'y' key for every file when prompted.

- 3 -

Enter:

gzip -9 backup.tar

...to compress the 'backup.tar' file. The '-9' bit, means 'use the highest compression rate'.


Now Let's Unzip That File!

- 1 -

Enter:

gunzip backup.tar.gz

- 2 -

Enter:

tar xvf backup.tar

By Laurence Hunter laurence@thebits.co.uk

Home Contents Previous Next

Download Latest Manual

www.THEBITS.co.uk - updated daily...