From Notes Wiki
Revision as of 12:06, 14 January 2020 by Saurabh (talk | contribs) (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: <...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.