Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Log archive

$
0
0
Hi,

I am trying to move old file to archive folder.

find /sourcedirectory/logs/* -type f -mtime +30 -exec mv "{}" /sourcedirectory/logs/archive \;


The above command not only search for old file in /sourcedirectory/logs/ folder but also searchs in /sourcedirectory/logs/archive ( what I meant to say is its doing recursive search.)

I dont want do recursive search. Can you help me in command which does not do recursively.

find /sourcedirectory/logs/* -type f -mtime +30 - which does recursively.

what is the command for non recursive?
Thanks for your help.

Viewing all articles
Browse latest Browse all 16232

Trending Articles