Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I find Zero length files??? 2

Status
Not open for further replies.

TheBOFH

IS-IT--Management
Dec 7, 2000
1
US
I have a load of zero length files around in my file system.
I want to first find them, then delete them.

This almost works:
ll -R /moose |grep ' 0 '|awk '{print $9}'|xargs -n 1 -t -i rm -i {}

The problem is that the full path is not returned from the awk, only the filename. So the delete fails...

Does anyone have any ideas how to make this work or be able to point me in the right direction.

Many Thanks
Colin
 

find /moose -size 0 -exec rm -i {} \;
Jean Pierre.
 
Be careful removing zero byte files, especially if you are logged in as root. These files are used as flags by the operating system, removing them can have serious consequences.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top