10

Using -exec with and without -name

view full story
linux-howto

http://www.unix.com – Hi, I need to delete the last N days file using find. I am trying to use find . -mtime -10 -print which lists down required files. but when i use find . -mtime -10 -exec ls -lrt {} \; it gives me all files in the directory including the required files but the required files are having ./ preceded with them. Now when I tried find . -name '*.txt' -mtime -10 -exec ls -lrt {} \; It gave me proper output i.e. only required .txt files. But i want to check for all the files in that directory and not just .txt files. Can someone please help me out and let me know why -exec is respo (HowTos)