LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 01-02-2012, 02:02 AM   #1
Ayesha12
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
zip in solaris


Hi,

I want to zip directories on my solaris box, but i am not able to find a proper command,

i used zip -r <dirname>.zip <dir name>
but a file with a unique name was created which dnt have the contents,

i used tar -cvEf only archiving was done.
I need to zip 100GB directories to save space.

Please help
 
Old 01-02-2012, 03:17 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use:
Code:
/usr/bin/tar cvf - /path/to/directory |gzip - > directory.tar.gz
BTW the zip -r should work too

Regards
 
Old 01-02-2012, 03:46 AM   #3
Ayesha12
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,

Thank you for the reply, but how will i unzip and extract the files?
 
Old 01-02-2012, 04:33 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

If you used the tar/gzip command above, you should run:
Code:
gunzip < directory.tar.gz | tar xvf -
If you used zip then unzip filename.zip should do the job

Regards
 
Old 01-02-2012, 07:10 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Ayesha12 View Post
I want to zip directories on my solaris box, but i am not able to find a proper command,

i used zip -r <dirname>.zip <dir name>
but a file with a unique name was created which dnt have the contents
As already written, "zip -r" should work.
How did you conclude the zip file had no content ?
What says
Code:
zipinfo dirname.zip
?
 
  


Reply



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
zip + attach sending to mail from solaris box. Sha_unix Solaris / OpenSolaris 9 09-27-2011 02:16 AM
Linux zip program's -d -tt option deletes all files from zip archive Arun Gupta Linux - Software 4 04-27-2011 07:06 PM
drivers for iomega zip 250 zip driveH tony044 Linux - Newbie 5 09-14-2010 06:19 AM
PHP ZIP MYSQL - open zip without writing it to disk benjalien Programming 2 01-15-2010 05:14 AM
create a self-extracting zip file with zip on solaris? samsolaris Solaris / OpenSolaris 3 10-15-2004 01:50 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:21 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