Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Deleting old files from directory

by chrestomanci (Priest)
on Sep 28, 2011 at 08:57 UTC ( #928260=note: print w/replies, xml ) Need Help??

in reply to Re^2: Deleting old files from directory
in thread Deleting old files from directory

I use an explicit pipe to xargs instead of using the built in delete action, because that way it is easier to check I am deleting the correct files, as I can use ls on the end of the xargs command instead of rm.

Another way to handle spaces in filenames is to configure find to separate output with nulls instead of spaces, and then have xargs expect those nulls.

find <directory> <conditions> -print0 | xargs -0 ls -l

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928260]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2016-10-21 13:35 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.