![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check all files in directories for string and remove.. possible? | LordJezo | Shell Programming and Scripting | 7 | 11-30-2005 01:00 AM |
| file size check | malaymaru | Shell Programming and Scripting | 2 | 10-19-2005 12:26 AM |
| Check file size | alnita | UNIX for Dummies Questions & Answers | 6 | 06-20-2005 02:34 PM |
| How to check if 3 files have same size in directory | oggle | Shell Programming and Scripting | 5 | 02-16-2005 12:51 PM |
| remove files with 0 size, space and double qoute | nongrad | Shell Programming and Scripting | 3 | 02-08-2002 03:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Check file size and remove files
Hi,
Here we have a situation where we have to check the file size and if the file size is greater than 0 bytes then remove the files from the directory. 1)EdwTrxn 2)EdwPost 3)EdwTndr 4)EdwSls 5)EdwSlsRej 6)EdwTndrRej Files will be created in the directory in the following manner. If any of the Rej files (5.EdwSlsRej 6.EdwTndrRej) size is greater than 0 bytes then we have to delete remaining 4 files (1.EdwTrxn 2.EdwPost 3.EdwTndr 4.EdwSls ).Else if Rej files size is 0 bytes then We have to remove those 2 Rej files(5.EdwSlsRej 6.EdwTndrRej) from the directory. Thanks |
|
||||
|
Hi,
I am new here.I want to write a script with following conditions - 1. I have files with name IF008* 2. If size of the file IF008* is 84 bytes then move it to junk folder 3. If size of the file IF008* is greater than 84 bytes then move it to tmp folder. Please reply. All ideas are appreciated. |
|
||||
|
Code:
find dir/ -type f -name 'IF008*' -size 84c -exec mv {} junk/ \;
find dir/ -type f -name 'IF008*' -size +84c -exec mv {} tmp/ \;
-Devaraj Takhellambam |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|