4

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?

wjandrea
  • 14,236
  • 4
  • 48
  • 98
thomas
  • 383

1 Answers1

3

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.

slava
  • 3,887