Linux – Find files that have been modified by the Linux server within 24 hours

Find files that have been modified by the Linux server within 24 hours… here is a solution to the problem.

Find files that have been modified by the Linux server within 24 hours

I need to find files that have been modified in the last 24 hours, there are no subfolders. I have this command

find /var/www/html/test/ -mtime -1 -type f -exec ls -l {} \;

This displays all modified files in the folder and subfolders. But I only need specific folders that have been modified in the last 24 hours.

So please anyone help and tell me to show the modified command in the parent folder.

Solution

Just add -maxdepth 1

find . -maxdepth 1 -mtime -1 -type f -exec ls -l {} \;

Related Problems and Solutions