On Unix-like operating systems, such as Linux or OS X/macOS system, you can use the find command to locate files based on specified criteria. If you want to see just those files modified within the last day, you can use a command such as the one below:
$ find /home/jdoe/Documents -mtime -1 -type f -print
The command above would list those files created within the
/home/jdoe/Documents
directory and its subdirectories that
were created in the last day, which is specified with -mtime -1
.
The mtime
references a file's modification time and the minus one
indicates you only want to see those files created today; -type f
indicates you are only interested in files, not directories or other objects
while -print
indicates you want find
to display the
names of the files it finds that match the specified criteria. Note: this
method will show files created within the last 24 hours, not just those
created since the start of the current day at midnight the previous night.
An alternative method, to see just those files created or modified since the
beginning of the current day, is to specify today's date with
-newermt
. E.g., if today is July 8, 2017, I could use
the command below to find files with a modification time newer than the
specified date:
$ find /home/jdoe/Documents -newermt 2017-07-08 -type f
That command will also show me the files in the specified directory that were created or modified today.
References:
Related posts:
-
Finding files modified on or after a date on a Linux system
Date: January 11, 2015