Find files newer than x Days on Linux - easy way
in terminal / command line
using "find" command
Code:
:~$ find * -mtime -30 | xargs ls -lh with pipe
:~$ find -atime $mtime -exec rm -f {} without pipe
Unfortunately, no one can be told what the Matrix is. You have to see it for yourself. by MORPHUS.DK
Showing posts with label xargs. Show all posts
Showing posts with label xargs. Show all posts
08 February, 2010
How to delete files older then x-days on Linux
Delete Files Older then x Days on Linux - easy way
in terminal / command line
using "find" command
Code:
in terminal / command line
using "find" command
Code:
find *.txt -mtime +30 | xargs rm
- "find" executing program
- "*.txt" file
- "-mtime +30" files older then 30 days
- " | " pipe
- "xargs" executing program
- "rm" executing command
Subscribe to:
Posts (Atom)