Hi, i need to strip out a logfile dir, but only remove the files with 0kb . How would i go about doing this?
TIA
Hi, i need to strip out a logfile dir, but only remove the files with 0kb . How would i go about doing this?
TIA
ls -l|while read line
do
awk '$5 != 0 {print $0}'
done>file1
$5 is the fifth field in output of ls - l which gives the no. of characters in the file. so i hv written all the files which dont hv zero characters (or bytes) to file1
find /path/to/logs -type f -size 0 -exec rm -f {} \;
thanks v much for your help i used
find . -size 0 -exec rm {} \;
which indeed worked perfectly.