LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-27-2005, 08:08 PM   #1
compzoo
Member
 
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

Thanx

Last edited by compzoo; 01-27-2005 at 08:15 PM.
 
Old 01-27-2005, 09:01 PM   #2
BajaNick
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 09:11 PM.
 
Old 01-27-2005, 10:31 PM   #3
voyciz
Member
 
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.
 
  


Reply


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 09:20 PM
What are those folders? Ephracis LQ Suggestions & Feedback 2 02-25-2005 08:34 AM
.zip help Jmcatch742 Linux - General 1 11-16-2004 09:07 PM
create a self-extracting zip file with zip on solaris? samsolaris Solaris / OpenSolaris 3 10-15-2004 01:50 AM
So many folders merchtemeagle Linux - Newbie 4 10-07-2004 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:58 PM.

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