Find files created or modified in the last days with find
In the shell, run:
$ find ~ -mtime 0
to display files created or modified within the last 24 hours.
$ find ~ -mtime 1
to display files created or modified between 24 and 48 hours ago.
$ find ~ -mtime -3
to display files created or modified within the last 3 days.
$ find ~ -mtime +3
to display files created or modified older than three day.
The option -mtime
tells find
to display files which were created or modified n*24 hours ago. Meaning that find
counts the number of 24-hour periods that have elapsed since the file was created or modified. Decimals are ignored. You can read more about -mtime
on the man page of find. Which you can display by running
$ man find
in the shell.
find is copyleft-licensed and was published in 1971.
Other wikis:
- Find files or directories from the command-line with find
- Move (cp) all files found with the command find
personal computing command-line interface (cli) shell literacy gnu linux trisquel find office applications wiki text processing