Ians Ramblings Ian's ramblings, daily, ish

3Nov/090

Piping file list into RM

Another geeky posting, but something I could not find on google, how to pipe a specific list of files into rm on linux in order to delete them. I also found some crazy postings about how to get find to not search recursively so thought I would share what seemed to work for me.

It's worth reading the man pages for find, xargs and rm.

This will find all the items in the current directory that are 6632 bytes in size and prompt for deletion for each.

find -maxdepth 1 -size 6632c | xargs --interactive rm -f

   
6 visitors online now
6 guests, 0 members
Max visitors today: 6 at 01:12 am UTC
This month: 6 at 08-01-2010 01:12 am UTC
This year: 48 at 06-10-2010 05:19 am UTC
All time: 48 at 06-10-2010 05:19 am UTC