I am new to unix and couldn't get appropriate outcome in other questions.
I want to list only files in current directory which are older than x days. I have below restriction
file1 file2 file3 ..
I used find . -mtime +30
. but this gives files and files in sub-directories as well. I would like to restrict doing search recursively and not to search inside directories.
Thanks a lot in advance !
You can do this:
find ./ -maxdepth 1 -type f -mtime +30 -print
If having problems, do:
find ./ -depth 1 -type f -mtime +30 -print
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With