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?
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?
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
.
find /home/mypc -name "backup*"
vs find /home/mypc/backup*
– wjandrea
Nov 12 '18 at 14:40