How to compress a directory on a Sun Solaris 5.7 ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to compress a directory on a Sun Solaris 5.7 ?
# 1  
Old 08-22-2003
How to compress a directory on a Sun Solaris 5.7 ?

Hi,

Is there any utility to compress an entire directory on a Sun Solaris 5.7 ? Something like "compressdir" on other flavours of Unix ?

Thanks
# 2  
Old 08-22-2003
Check out the tar command or cpio command. Both will archive directories. Once you have created the tar-ball you can then gzip it! On Solaris, there is a program called pax though I have never used it.
# 3  
Old 08-22-2003
......

i think tar does what you want....
search the man page for more information

this is a solaris question and should be posted in our new solaris forum (thx to neo) ;-)
.
# 4  
Old 08-22-2003
Thanks

Thanks google and pressy for your prompt response.

google -> My server does not have much space and backing up on tape would have taken much time and anyway, I wanted free space temporarily. Hence, I was looking for something, which would compress contents of all sub-directories.
gzip is available on our server, which has an option -r, which recursively compresses all files of a specified directory.

Pressy - > This topic should have been opened in Solaris forum. Please excuse me.
# 5  
Old 08-23-2003
Re: Thanks

Quote:
Originally posted by sameerdes
My server does not have much space and backing up on tape would have taken much time and anyway, I wanted free space temporarily. Hence, I was looking for something, which would compress contents of all sub-directories.
gzip is available on our server
Tar is more than a tape backup program. Tar w/ gzip installed on the server would be able to create a compressed recursive backup of directory that you need backed up. I use this quite frequently when I need a quick backup of a website. I believe tar is recursive from the directory that you started down the tree.

try using:

"tar -cpz * > filename.tar.gz"

I used * as wildcard to take everything in the dir i am in and everythign underneath it, but you can specify any file or dir that you want.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I compress all files in a directory?

the problem states "Write a script that compresses all the files in the directory. Make a directory and put some files in it. Also make a sub directory in your directory and put files in it also. Once you have this basic ability to compress all files within a directory, add to your script a menu of... (1 Reply)
Discussion started by: Brittany
1 Replies

2. Shell Programming and Scripting

Archive directory script with tar/compress

Hi all I need to write a script that archives all files with a certain date in the filename, to another location. It has to run on a AIX using tar/compress or another standard AIX tool. The directory will have x files, each prefixed with a date like yyyymmdd_desc.csv. I need all to... (7 Replies)
Discussion started by: AIXfrog
7 Replies

3. Shell Programming and Scripting

Compress the contents of a directory while copying data into it

Hi guys I have a need to compress the contents of a directory while I am copying data into it. I was able to do this when it was only one file by doing as below: STEP1: mknod myfile p STEP2: chmod 777 myfile STEP3: compress -v < myfile > myfile.Z & STEP4: cp -p xyz_file myfile... (2 Replies)
Discussion started by: user1602
2 Replies

4. Solaris

how to tar a directory in a sun solaris?

i have lot of directories which are needed to be transferred to a LINUX workstation. to do this i need to tar the directories. please let me know how to tar the directories in Sun Solaris. (7 Replies)
Discussion started by: mmb
7 Replies

5. Shell Programming and Scripting

compress Directory

Hi Friends, I have a directory under which 10 more directories are there. In each 10 directories there are several files. I want to do FTP. But in FTP we cannt Transfer the main directory. each Time we have to go to the respective directry and then we have to to FTP. For this instance I... (9 Replies)
Discussion started by: deep_kol
9 Replies

6. Shell Programming and Scripting

How to Compress files before moving them in a directory

I need a shell script that zips a file before moving them..please help (3 Replies)
Discussion started by: godalle
3 Replies
Login or Register to Ask a Question