hi folks,
I want to select all files older than 13 days from a specified directory
for that i used
find /home/amar -name '*.*' -mtime 13
but it gives me all the files from subdirectories also, I dont want that
I want files only from /home/amar and not from /home/amar/abc/..
which option is suitable here -depth,-mindepth,-prune ?
how to use it ???
thanx Hitori,
but i am having problem that in the statement how to use it ??
find /home/amar -maxdepth 1 -name '*.*' -mtime 13
find /home/amar -name '*.*' -mtime 13 -maxdepth 1
find -maxdepth 1 /home/amar -name '*.*' -mtime 13
are not working
Hitori
4
May be you forget to add '+' to the -mtime's argument option.
this works fine for me (with another directory :)):
$ find /home/amar -maxdepth 1 -name '*.*' -mtime +13
It says find: bad option -maxdepth
Hitori
6
Then you out of luck. What version of find do you use?
Hitori
7
$ find --version
GNU find version 4.2.27
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX
I am sorry I did not understatnd what you meant in the last post.How do I find out the version.