Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: File not found error

by rrrrr (Novice)
on Oct 11, 2012 at 05:00 UTC ( #998361=note: print w/replies, xml ) Need Help??

in reply to Re: File not found error
in thread File not found error

Hi aitap

I want one liner command to delete non empty directories older than days. So tried of find command. I want to pass the path name and no of days through a find command. I searched hardly I couldnt find anything.

Replies are listed 'Best First'.
Re^3: File not found error
by aitap (Deacon) on Oct 11, 2012 at 15:44 UTC

    man find:

    SYNOPSIS find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [express +ion] <...> find: paths must precede expression
    So, first, move all your paths to search into before any expressions. Next, replace -exec rm -rf {} ; with -ls in order to debug your expression and make sure it finds only what you want to delete. Next, run and check that your command runs and returns expected results. Finally, move -exec rm -rf {} ; back in its place.

    You can also use find2perl to make a Perl program from find expression or start manually using File::Find instead.

    Sorry if my advice was wrong.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998361]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-12-17 19:59 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (466 votes). Check out past polls.