compress Directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting compress Directory
# 1  
Old 11-27-2007
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 have to go to the each 10 directry and then do the FTP.

is there any way we can compress the main directry?
Like in windowds we make .zip files.

Thanks In advance!!
Deepak
# 2  
Old 11-27-2007
use 'tar' to archive what you need and transfer a tar file.
# 3  
Old 11-27-2007
I dont think tar ll work . Bcoz for tar we need to have tape drive.
Then we can use tar -cvf filename.
# 4  
Old 11-27-2007
Quote:
Originally Posted by deep_kol
I dont think tar ll work . Bcoz for tar we need to have tape drive.
Then we can use tar -cvf filename.
why do you need a tape drive?
# 5  
Old 11-27-2007
Thanks Its working !!
tar -cvf sales_mkt.tar M2_Sales
tar -xvf sales_mkt.tar

I need one more help.
can we make it .zip file .so that i can FTP the .zip file and
in windows i ll unzip it through winzip

Thanks in advance!!
# 6  
Old 11-27-2007
depending on your OS/installation - look into 'zip', 'gzip', 'compress' or 'pack'
# 7  
Old 11-27-2007
Hi Vgersh99,
Thanks for your quick response.

I can make .zip fies like the following way

tar -cvf sales_mkt.zip M2_Sales.
But when I FTP it and try to unzip it in windows through winzip .It gives me error.


But the reverse way is possible .I can unzip the folder in windows.
Then ftp it (bin mode)into unix server .then I can unzip it like

$unzip filename.zip
Login or Register to Ask a Question

Previous Thread | Next Thread

10 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

script to compress files in directory that changes its name every day

Hi all I have the following script that should compress a file in a directory: # compress log files older than 2 days find /u01/easydone/DBDUMPS/*.dmp -mtime +2 -exec gzip {} \; BUT the problem is that these files that I want to compress are inside a directory with following format: ... (5 Replies)
Discussion started by: fretagi
5 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Issue: Compress in unix server and FTP to windows and open the compress file using Winzip

Hi All ! We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows. I have used the utility ZIP like the below. zip -e <newfilename> df2_test_extract.dat but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies

5. UNIX for Dummies Questions & Answers

Need help to compress

People i have files.arc i need to compress one by one...but they need to have the same date for example jan 30 1234.arc jan 30 12334.arc jan 30 rejrne.arc jan 30 e423e4.arc jan 30 afdhnfhd.arc jan 31 aresdfds.arc I need to compres the jan 30 .arc only thank you very much (1 Reply)
Discussion started by: enkei17
1 Replies

6. 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

7. Shell Programming and Scripting

compress files

Could someone give me an idea how to compress all files from a given directory that are not of type .z (compressed). Please help. (2 Replies)
Discussion started by: lesstjm
2 Replies

8. UNIX for Dummies Questions & Answers

Compress command

compress /var/opt/l2/amer/art2/USFINUM0200_.CSV compress /var/opt/l2/amer/art2/USFINUM200_.CSV compress /var/opt/l2/amer/art2/USFINUM020_.CSV compress /var/opt/l2/amer/art2/USFINUM20_.CSV Is there a way to shorten this or write it in a script. The file to be compressed will be USFINUM but... (5 Replies)
Discussion started by: indira
5 Replies

9. 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

10. UNIX for Dummies Questions & Answers

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 (4 Replies)
Discussion started by: sameerdes
4 Replies
Login or Register to Ask a Question