![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting from Mac on GUI? | wmosley2 | OS X (Apple) | 1 | 12-10-2003 08:06 PM |
| Deleting by ID | boyler | Shell Programming and Scripting | 1 | 09-23-2003 07:37 PM |
| Printing Problems in unix ... ( Bar-cdoe - Ip Printing) | QuickSilver | UNIX for Advanced & Expert Users | 3 | 06-04-2002 07:48 AM |
| deleting lines | supercbw | High Level Programming | 1 | 05-06-2002 09:53 AM |
| usb - deleting (irq) | termiEEE | UNIX for Dummies Questions & Answers | 1 | 04-18-2002 02:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to print and delete at the same time 0KB files... using following command
a-> find . -type f | xargs ls -l | awk '{ if($5 == 0) {print $0;}}' | xargs rm $0 but am not successful. Can somebody tell me how to do this ... same time I need files to be printed as well deleted later. I used tee command as well like this b-> ListFilesZKB | tee | xargs rm $0 where ListFilesZKB is shell script for (a) excluding last pipe. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Tadaaaa:
Code:
find . -type f -size 0 -print -exec rm {} \;
|
|
#3
|
|||
|
|||
|
Hi I tried the same u specified it didnt work all zero KB files still present.
But this wont give any error message, just gets completed. |
|
#4
|
|||
|
|||
|
Something is not right, zaxxon's example is correct, based on what you asked.
What output does this produce? Code:
find . -size 0 -exec ls - l {} \;
|
|
#5
|
|||
|
|||
|
thx it worked ... but I wanted listing of files in long format.
|
|||
| Google The UNIX and Linux Forums |