Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-27-2005, 09:08 PM   #1
Registered: Jan 2005
Location: Indiana
Distribution: Suse 9
Posts: 38

Rep: Reputation: 15
zip or compress folders?

How can I zip or compress a folder to include all subdirectories? I want to end up with a tar.gz


Last edited by compzoo; 01-27-2005 at 09:15 PM.
Old 01-27-2005, 10:01 PM   #2
Senior Member
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
You can try " tar -cf Directory.tar.gz Directory" substitute Directory for the name of the directory you want, but do a test first, as I dont know if that will work on directories the same as files.

Also type man tar and tar --help at command line for some very usefull information.

UPDATE: It looks like it does work the same. I just did a test by creating a few subdirectories and then creating a file with some words in it and then issued the above, deleted the original then issued tar -xvf test.tar.gz test and it worked!

Last edited by BajaNick; 01-27-2005 at 10:11 PM.
Old 01-27-2005, 11:31 PM   #3
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
I think you want to pass the -z option to tar as well, otherwise the archive won't be compressed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
folders qerf Linux - Newbie 1 11-19-2005 10:20 PM
What are those folders? Ephracis LQ Suggestions & Feedback 2 02-25-2005 09:34 AM
.zip help Jmcatch742 Linux - General 1 11-16-2004 10:07 PM
create a self-extracting zip file with zip on solaris? samsolaris Solaris / OpenSolaris 3 10-15-2004 02:50 AM
So many folders merchtemeagle Linux - Newbie 4 10-07-2004 09:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration