1833294 Members
3010 Online
110051 Solutions
New Discussion

Re: gzip the dirrectory

 
SOLVED
Go to solution
Mousa55
Super Advisor

gzip the dirrectory

HI
i have a crash directory including more one file and the same time is big size
i want to gzip this directory by gzip command how that.
i tried to use tar command but there something error
tar -cvf /?? /var/adm/crash/crash.0

thanks and best regards
14 REPLIES 14
Jeeshan
Honored Contributor

Re: gzip the dirrectory

Hi Nejad

The command should be

#tar -cvf .tar /var/adm/crash/crash.0
a warrior never quits
Rasheed Tamton
Honored Contributor

Re: gzip the dirrectory

Hi,

You can use gzip -r on the dir.

gzip -r /var/adm/crash/crash.0

Regards.
Rasheed Tamton
Honored Contributor
Solution

Re: gzip the dirrectory

tar cvf - /var/adm/crash/crash.0 | gzip - > crash.tar.gz

If you want to make a zipped file for sending to another location you can use the above command.

Regards.
YAQUB_1
Respected Contributor

Re: gzip the dirrectory

tar cvf .tar /var/adm/crash/crash.0
gzip .tar

Mousa55
Super Advisor

Re: gzip the dirrectory

Hi
i am using the gzip -r but i am not fount the result
where the destination output of this command thanks
Rasheed Tamton
Honored Contributor

Re: gzip the dirrectory

gzip -r will compress all the files in the dir including all the files in the subdirectories. If you go to /var/adm/crash/crash.0 dir, you will see all the files with .gz extension

If you want to send the compressed files to a different location then you have to use the gzip with tar as above and send the output file to the destination.

Regards.
Jeeshan
Honored Contributor

Re: gzip the dirrectory

Hi Again

the gzip -r command will zip the files under the directories.

if you wanna zip the crash.o folder follow the command i stated earlier.
a warrior never quits
Sajjad Sahir
Honored Contributor

Re: gzip the dirrectory

Dear Najad

u can use gzip -r command


thanks and regards

sajjad
Dennis Handly
Acclaimed Contributor

Re: gzip the dirrectory

>i want to gzip this directory by gzip command how that.

Does gzip help much with compression? I thought the crash images there were already kind of compressed.
Could you please provide some before and after sizes?
Mousa55
Super Advisor

Re: gzip the dirrectory

Hi
i am using this command but the comprressed is not compleate
#tar -cvf /var/adm/crash/crash.0 | gzip > crash.tar.gz
but this message is Appeared and i can see the file crash.tar.gz but it is Corrupted
or empty

thanks
Mousa55
Super Advisor

Re: gzip the dirrectory

Hi
sorry this the message
tar: usage tar [-]{txruc}[eONvVwAfblhm{op}][0-7[lmh]] [tapefile] [blocksize] [[-C directory] file]
thanks
Rasheed Tamton
Honored Contributor

Re: gzip the dirrectory

cd /var/adm/crash
/var/adm/crash:> tar cvf - ./crash.0 |gzip - > crash.0.tgz
/var/adm/crash:> ll
total 16
-rw-rw-rw- 1 root sys 456 Apr 27 10:01 crash.0.tgz
Rasheed Tamton
Honored Contributor

Re: gzip the dirrectory

cd /var/adm/crash/
tar cvf - ./crash.0 |gzip - > crash.0.tgz

After cvf, there is hyphen (-) and after gzip also there is hyphen

Regards.
Mousa55
Super Advisor

Re: gzip the dirrectory

Thanks for all