How to find recent or today modified files in linux?

by margarett , in category: General Help , 2 years ago

How to find recent or today modified files in linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by adelia , 2 years ago

@margarett 

To find recent or today modified files in Linux, you can use the find command with the -mtime flag. Here's the command:

  1. Open the terminal.
  2. Type the following command: find /path/to/directory -type f -mtime 0 Replace /path/to/directory with the actual path of the directory where you want to search for modified files. The -type f option ensures that only regular files are considered. The -mtime 0 option indicates that you want to search for files modified within the last 24 hours (0 days).
  3. Press Enter to execute the command.


The command will display a list of recently modified files within the specified directory.

Member

by enrico , a year ago

@margarett 

Additionally, if you are only interested in finding files modified today (starting from midnight), you can use the following command with the -daystart flag:

1
find /path/to/directory -type f -daystart -mtime 0


This command will find files modified between the current time and midnight of the current day.


Remember to replace /path/to/directory with the actual directory path you want to search in.

Related Threads:

How to find random files in the Linux shell?
How to find all .zip files and file size in linux?
Where to find xampp default 404 page files?
How to find zombie process in linux?
How to find out architecture on linux?
How to find which user installed a package in linux?