Mar 10, 2009 #1 ksdh Technical User Oct 24, 2007 41 IN Hi I have a directory with hundreds of files. I would like to delete files older than a day. How could i do this? Would mtime work? Thanks
Hi I have a directory with hundreds of files. I would like to delete files older than a day. How could i do this? Would mtime work? Thanks
Mar 10, 2009 #2 PHV MIS Nov 8, 2002 53,708 FR find /path/to/dir -type f -mtime -1 | xargs rm Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
Mar 10, 2009 #3 motoslide MIS Oct 30, 2002 764 US How about making that: find /path/to/dir -type f -mtime +1|xargs rm "Proof that there is intelligent life in Oregon. Well, Life anyway. Upvote 0 Downvote
How about making that: find /path/to/dir -type f -mtime +1|xargs rm "Proof that there is intelligent life in Oregon. Well, Life anyway.
Mar 11, 2009 #4 PHV MIS Nov 8, 2002 53,708 FR OOps, good catch motoslide, I've inverted the test. Upvote 0 Downvote
Mar 16, 2009 #5 stefanwagner Programmer Oct 19, 2003 2,373 DE Useless use of xargs. Code: find /path/to/dir -type f -mtime +1 -delete don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html Upvote 0 Downvote
Useless use of xargs. Code: find /path/to/dir -type f -mtime +1 -delete don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html
Mar 17, 2009 #6 KenCunningham Technical User Mar 20, 2001 8,475 GB Which flavour of find is that Stefan? I want to be good, is that not enough? Upvote 0 Downvote
Mar 17, 2009 #7 feherke Programmer Aug 5, 2002 9,540 RO Hi Doh, I would loose. My bet was that PHV will post that question. ;-) ( Is available in GNU [tt]find[/tt] since version 4.2.3, implemented on 2004-10-30. ) Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Doh, I would loose. My bet was that PHV will post that question. ;-) ( Is available in GNU [tt]find[/tt] since version 4.2.3, implemented on 2004-10-30. ) Feherke. http://rootshell.be/~feherke/
Mar 17, 2009 #8 KenCunningham Technical User Mar 20, 2001 8,475 GB Had a feeling it might have been, Feherke! I want to be good, is that not enough? Upvote 0 Downvote
Mar 17, 2009 #9 stefanwagner Programmer Oct 19, 2003 2,373 DE Ah - not in the Gnu/Linux-Server/Client-section? GNU-find on Linux, Version 4.2.32. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html Upvote 0 Downvote
Ah - not in the Gnu/Linux-Server/Client-section? GNU-find on Linux, Version 4.2.32. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html
Mar 17, 2009 #10 razalas Programmer Apr 23, 2002 237 US There is always -exec Code: find /path/to/dir -type f -mtime +1 -exec rm {} \; Code what you mean, and mean what you code! But by all means post your code! Razalas Upvote 0 Downvote
There is always -exec Code: find /path/to/dir -type f -mtime +1 -exec rm {} \; Code what you mean, and mean what you code! But by all means post your code! Razalas