Difference between revisions of "Find shell command"
From Notes_Wiki
(Created page with "<yambe:breadcrumb>Shell_scripting|Shell scripting</yambe:breadcrumb> =find shell command= ==Find files older than given no. of days== To find files older than 30 days use: <...") |
(No difference)
|
Revision as of 12:06, 14 January 2020
<yambe:breadcrumb>Shell_scripting|Shell scripting</yambe:breadcrumb>
find shell command
Find files older than given no. of days
To find files older than 30 days use:
find . -mtime +30 -daystart
Careful To automatically delete files older than 30 days use:
find . -mtime +30 -daystart -delete
To find files modified within last 5-6 days use:
find . -mtime +5 -mtime -6
There is also atime and ctime for access times and change times respectively. mtime used in above examples is for modification times.