Visit The New, Modern Unix Linux Community


Compress command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Compress command
# 1  
Compress command

PHP Code:
compress /var/opt/l2/amer/art2/USFINUM0[1-9]200[6-9]_[1-3].CSV
compress 
/var/opt/l2/amer/art2/USFINUM[10-12]200[6-9]_[1-3].CSV

compress 
/var/opt/l2/amer/art2/USFINUM0[1-9]20[10-99]_[1-3].CSV
compress 
/var/opt/l2/amer/art2/USFINUM[10-12]20[10-99]_[1-3].CSV 
Is there a way to shorten this or write it in a script. The file to be compressed will be USFINUM but as you can see the month and the year will change and there can be three files (1-3).

Thanks a lot.

Regards,
Indira
# 2  
How about using !

Code:
compress /var/opt/l2/amer/art2/USFINUM*

Do you want to compress all the USFINUM values under compressed directory ?
# 3  
Thanks a lot. I tried using the wildcard and that did not work. Unix cannot find the file in that case.

Regards,
Indrani
# 4  
Quote:
Originally Posted by indira
Thanks a lot. I tried using the wildcard and that did not work. Unix cannot find the file in that case.

Regards,
Indrani
cannot find the file !! ??!!!

are you able to view the files when displayed with ls /var/opt/l2/amer/art2/USFINUM*
# 5  
I am sorry, did not explain properly. When I run this command with the wild card * it does not pick up the files to compress - probably there are 2-3 files with that name but with different month, year and extensions. Though the file name starts with USFINUM. So had to make it so long.

Thanks for the help.

Regards,
Indira
# 6  
Quote:
Originally Posted by indira
I am sorry, did not explain properly. When I run this command with the wild card * it does not pick up the files to compress - probably there are 2-3 files with that name but with different month, year and extensions. Though the file name starts with USFINUM. So had to make it so long.

Thanks for the help.

Regards,
Indira
what difference it is going to make if they have different month / year / day ?
everything would be selected for compression by the meta character ' * '

name20070809.txt
name20061223.txt
name20070230.txt

all the files should be selected the command name*
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #865
Difficulty: Easy
The original idea of a member badging system at UNIX.com was first proposed by Ravinder Singh in 2018.
True or False?

10 More Discussions You Might Find Interesting

1. Red Hat

Command to compress a file

Hi, When we want to compress a file which is of huge size then what command is best for us.Kindly suggest on this. 1.Tar command or 2.gzip command OS -- Linux 2.6 Regards, Maddy (6 Replies)
Discussion started by: Maddy123
6 Replies

2. UNIX for Advanced & Expert Users

UNIX: Command to compress folder and all files into a tar

I am trying to grab a folder and all the folders and files underneath it and send it from one computer to another. I basically want to compress the whole folder into a tar, tgz, or zip file so that it can be sent as one file. is there a command to compress a folder and all its contents into a tar... (7 Replies)
Discussion started by: kane4355
7 Replies

3. UNIX for Dummies Questions & Answers

Compress the file using Tar command

Hi, When i am tar the file particular ,csv file format in a folder i am receiving the error Command: tar cf New_data.tar /new/file/mari/getdata/small/*.xml Arguements too long But sometimes i am able to compress other folder but the tar folder contains all the file format and... (10 Replies)
Discussion started by: marivinay
10 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

Copy Compress as one command

Hi, I need to copy and compress files in a directory in single line of command. I am able to copy and gzip files in one command but not directory. Command that I am using for copying directory is below : cp -rp /u01/app/<directory> /u01/app/backup |gzip -r /u01/app/backup/<directory> ... (10 Replies)
Discussion started by: findprakash
10 Replies

6. Shell Programming and Scripting

combining mv and compress command

Hi All, I have a file in DirA/ABC.out a need to move to DirB.I am using the following steps now: mv DirA/ABC.out DirB compress -f DirB/ABC.out Is there a way to just do this one step as I have to move hundreds of files every hour. -Thanks in advance. (4 Replies)
Discussion started by: sam_78_nyc
4 Replies

7. Linux

lp command with compress mode

I want to know whether lp command is having option for setting compess mode in linux.Is it possible to pass escape characters to lp command to set printing in compress mode. (3 Replies)
Discussion started by: zita
3 Replies

8. SCO

Help on compress command

Hello. Can any1 help me with the compress command. The -b option takes the number of bits used for encoding. can u expalin why this number of bits is used and for what purpose. what is the maximum number we can provide? In SFU these number has a valod range between 12 and 16 y?? (1 Reply)
Discussion started by: rahulrathod
1 Replies

9. UNIX for Dummies Questions & Answers

tar command with compress option...

Hi ! i have to write a script that archivs homes not used since 3 years. First, my script gathers the users that are concerned, using the following command : ll -lt /home/*/.sh_history | egrep '2000|1999|1998|1997' | awk '{print $3}' i obtain a list like this : user_1 user_2 ...... (3 Replies)
Discussion started by: tomapam
3 Replies

10. UNIX for Dummies Questions & Answers

cpio command with compress

Hi friends.. I want to be able to copy a file from one location to another (locally). The location the files are copied to should have compressed instances of the files they were copied from. copy from /home/user/test.file copy to /backup/user/test.file.Z I need to be able to do this... (1 Reply)
Discussion started by: sureshy
1 Replies

Featured Tech Videos