gzip a directory (URGENT)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting gzip a directory (URGENT)
# 1  
Old 05-28-2008
gzip a directory (URGENT)

Hi I have one directory as "eAMRLTXFLDS0"...I am supposed to create a
eAMRLTXFLDS0.ofcld.gz using gzip...

Can u plz help me wth the command..

Thanks in advance..
# 2  
Old 05-28-2008
man gzip will give you the answer.
sorry, It does not, it gives a different answer than what you are looking for..

I think you should use it in combination with tar..

Last edited by rvegmond; 05-28-2008 at 11:31 AM..
# 3  
Old 05-29-2008
I hope its not too late....

you could do something like this...
gzip -c <yourfile> > <dest file>
<your file> will be the extracted directory and the <dest file> will be the gzipped form of your dir!!!

Regards
# 4  
Old 05-29-2008
How about:
tar -cvf - <directory name> | gzip -c > <directory name>.tar.gz
# 5  
Old 05-29-2008
Code:
tar czf directory.tgz directory

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help creating gzip of directory files via cron

**BTW- very new to scripting** I have created a shell script to gzip the public_html files on our website. I have tested this script on another directory on our site and it worked, but when I replaced the directory with the public_html directory it failed. I am executing this script via a... (7 Replies)
Discussion started by: alblue
7 Replies

2. UNIX for Advanced & Expert Users

gzip vs pipe gzip: produce different file size

Hi All, I have a random test file: test.txt, size: 146 $ ll test.txt $ 146 test.txt Take 1: $ cat test.txt | gzip > test.txt.gz $ ll test.txt.gz $ 124 test.txt.gz Take 2: $ gzip test.txt $ ll test.txt.gz $ 133 test.txt.gz As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies

3. Shell Programming and Scripting

How to retain "directory" timestamp when using gzip?

Hello All, I am trying to gzip a directory contents with the option "-r". The file timestamps remaining same but not the directory, how to retain it too. ex: $ ls -l 20090624065000 total 1213360 -rwxrwxrwx 1 cisa users 529513119 Jun 24 2009 A -rwxrwxrwx 1 cisa ... (2 Replies)
Discussion started by: panyam
2 Replies

4. Shell Programming and Scripting

gzip files inside directory

Hello folks I hope every one is fine. I need to ask one question. I have directory /xx/abcd/data/ inside that data there are files like 11.txt 23.txt 12.txt *.txt i want that i will do compress each txt file inside that directory /xx/abcd/data/. But it will not gzip data... (1 Reply)
Discussion started by: learnbash
1 Replies

5. Shell Programming and Scripting

Bash: Gzip files in Directory and itīs Subdirectories

Hello dear Community, I have a task to wrtie a script which will gzip not zipped files in a directory and itīs subdirectories. I succeeded in gzippung the directory but not the subdirectories: #/bin/bash #go to the directory where to zip cd $1 #Zip unzipped files for i in `ls | xargs... (2 Replies)
Discussion started by: JamesCarter
2 Replies

6. AIX

GZIP ERROR! -- Plesae help! -- Urgent

I have two huge files on AIX Ver 5.0. File size of each file is 6238884375 bytes. There is huge difference in sizes when I zip them by gzip coomand. File1.gz 586147513 File2.gz 547585695 Any idea why it is so? Thanks Sumit (2 Replies)
Discussion started by: sumitc
2 Replies

7. UNIX for Dummies Questions & Answers

Decompress directory using Gzip

Hey there... Just has a query. I have been trying to zip and unzip a directory. I used gzip -c -r <directory> to recursively search the directory and zip it Now is want to unzip the directory, by gunzip -r <filename>.gz The problem is that the unzip creates on file with the contents... (1 Reply)
Discussion started by: jinxor
1 Replies

8. UNIX for Dummies Questions & Answers

gzip all the files in a directory

Hi, There are multiple files in a directory with different names.How can they be gzipped such that the timestamp of the files is not changed. (2 Replies)
Discussion started by: er_ashu
2 Replies

9. Shell Programming and Scripting

Urgent!!!Read directory from a file

I have a receive script file which had lots of direcorties to process,but now,I don't want to hardcode them,I need input the directory name in a Property.txt file,then write shell code to read the directory name from Property.txt to the script file so I can get flexible on it.But when I ran the sh... (3 Replies)
Discussion started by: joshuaduan
3 Replies

10. Shell Programming and Scripting

Searching files in a directory.Urgent

Hi everyone, I need to search files starting with RPT_0, RPT_1,........ in a directory. How can I implement that through a shell script. Also I want to read the last line of each file after searching them. Can someone help me out in this regard. One more thing how I can extract a particular... (7 Replies)
Discussion started by: srivsn
7 Replies
Login or Register to Ask a Question