From Notes Wiki
Jump to: navigation, search
(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)

Latest revision as of 12:06, 14 January 2020

Home > Shell scripting > Find shell command

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.