Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Can't find files older than 1 day

Writer Matthew Barrera

I want to find all files beginning by backup* older that 1 day in a folder.

I do:

find /home/mypc/backup* -mtime +1

But I am getting an empty list.

Where am I wrong?

2

1 Answer

From file system root dir:

sudo find / -name "backup*" -mtime +0

From user dir:

find ~/ -name "backup*" -mtime +0

-mtime +0 matches any file whose mtime difference is at least 24 hours. Tf you want mtime to count calendar days, and not n-24 hour periods from now, use -daystart: -daystart -mtime 0 is means today and -daystart -mtime +0 means before today.

Also you can find only files with adding -type f or only dirs -type d.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy