How do I compress all files in a directory?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I compress all files in a directory?
Prev   Next
# 1  
Old 04-09-2014
Question 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 options. Menu should give ability to compress all files within directory, as well as list, or delete a file.


HELP!!!!!!SmilieSmilieSmilieSmilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Compress a particular month files

Hi ALL, I am working on a folder where there are lot of files for the past one year. I need to compress a particular month files alone. suppose i need to compress the feb month files alone, what is the script we can use. Thanks in advance (2 Replies)
Discussion started by: acronis.84
2 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. 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

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

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

8. UNIX for Dummies Questions & Answers

Compress files

Hi All, I would like to archive some of the scripts below(USFINUM042006_01.CSV USFINUM042006_02.CSV and USFINUM042006_03.CSV )and also use a wildcard e.g. <command> USFINUM*.CSV. Also there are a lot of similar files but I want only the three latest files to be compressed. Which is the best... (3 Replies)
Discussion started by: indira
3 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
GATHER(1)						      General Commands Manual							 GATHER(1)

NAME
gather - gather up the files in a directory for transmission SYNOPSIS
gather [-s] source_dir [-d] dest_dir [-b] bytes [-f] file OPTIONS
-b Desired number of bytes per output file -d Destination directory -f Base name of output files -s Source directory EXAMPLES
gather # Collect files in current dir into 60K archives gather -d dir # Put the archives in dir gather -b 90000 # Try to produce 90K archives gather -s .. -d targ -b 5000 # Try to produce 5K archives DESCRIPTION
It is often useful to collect all the files in a directory into one or more archives for transmission by mail. This program collects all the files in the source directory (default: current directory) and puts them into a shar archive. The shar archive is then compressed and uuencoded. An attempt is made to have the final .uue file be about the given size (default: 60K), but since gather cannot really predict how much shar will add to the file, how much compress will reduce the file, and how much uue will add again, the sizes can fluctuate. If the -f file flag is given, the archives will be given the names file_00.uue, file_01.uue etc. If -f is not given, the name of the source directory is used as the base name. Since 7 characters of suffix are appended, the base name should not exceed 7 characters. GATHER(1)