I'm using the below command to list files older than 2 hours but it returns redundant output, am I missing something.
# find . -mmin +120 -exec ls -l {} \;
total 0
-rw-r--r-- 1 root system 0 Oct 13 09:52 test1
-rw-r--r-- 1 root system 0 Oct 13 09:52 test2
-rw-r--r-- 1 root system 0 Oct 13 09:52 test3
-rw-r--r-- 1 root system 0 Oct 11 23:02 dec7
-rw-r--r-- 1 root system 0 Oct 13 09:52 ./test1
-rw-r--r-- 1 root system 0 Oct 13 09:52 ./test2
-rw-r--r-- 1 root system 0 Oct 13 09:52 ./test3
-rw-r--r-- 1 root system 0 Oct 11 23:02 ./dec7
find . -type f -mmin +120 -exec ls -l {} \; -->worked.
Thanks for your prompt response but still wondering why I need to specify '-type f' (type file), it complains only while using -mmin flag and not when using -mtime flag because the below code works for me and I'm not using '-type f'
ls -il | awk ' !/total/ {print $1}' | while read ln
do
find . -inum $ln -mtime +1 -exec rm -f {} \;
done