user170773
user170773

Reputation: 33

Find files modified within 24 hours linux server

I need to find files modified last 24 hours without subfolders. I am having this command

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

This will show all the modified file within folder and subfolder. But I need only the particular folder that modified in last 24 hours.

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

Upvotes: 3

Views: 11121

Answers (1)

jhole
jhole

Reputation: 4226

Just add -maxdepth 1

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

Upvotes: 4

Related Questions