Monday, September 22, 2008

Create a zip archive of file or folder in linux

Hi folks,guys and gals...

Hope all are enjoying their days.

Ok, today i am going to show you, howto create a zip archive in linux. For time being i am using openSUSE 11.0, but i am 101% sure you can use this method in every distro of linux.

So lets start the job: 1st will start from a file.

You have a file on your desktop and want to zip  it.

1- Open terminal.

2- Write the command below:

  • cd /home/user_name/Desktop/

change user_name to your specific one. It will change path to Desktop in terminal.

Note: It can vary, upon your file, that where it is located.

3- Now lets assume, that your filename is test1.doc OR test1.pdf.

  • zip test1.pdf.zip test1.pdf

And thats it for a file.

Now lets take a whole folder, in which you have alot of files.

1- Do step one and two from above.

2- Suppose that your folder name is work.

  • zip -9 -r work.zip work

-9 = best compression

-r = recursive

work.zip = will change to zip archive, you can use anyone in linux. for example:

gzip, bzip2 etc.

work = your folder name.

And thats it for folder.

Hope that i make it easy for all to follow.

Have a nice day.

Arif(Blogger)

No comments:

Post a Comment