Delete an empty file from dir.

Hi,

I have an dir which has 50K file, some of them are empty. I want to delete the empty file from the dir. I am planning to use the following command.

ls -l | grep " 0 " | awk '{print $9}'

I can copy this to an file and then how do I use this file to delete the empty files.... Any help will be appreciated.:slight_smile:

Thanks.

You can do something like this with find:

find . -size 0 -exec rm -f {} \;

To be shure you get the correct files you can ls those files first with:

find . -size 0 -exec ls -l {} \;

Regards

Thanks it worked.:slight_smile: