Am using the following find command to list the files and got my desired output.
find /zamo/direct/test/ -name myfile* -mtime -25 |xargs ls -lht|grep -v total
The output must be as following, since I need to do awk,sed &cut from this
-rw-rw-r-- 1 zamo zamo 21M Jul 14 03:02 myfile_2008.07.14
It was working fine. I have my question here . If my search did not find a output for the 25 days using
find /zamo/direct/test/ -name myfile* -mtime -25
It is returning no output. But the
find /zamo/direct/test/ -name myfile* -mtime -25 |xargs ls -lht
is making an undesired output of listing all the files in the current directory from which the script is executed.
Is there any command or choice to avoid this kind of errors. I need the output if the "find" results an output of file with 25 days old. But "xargs ls -lht " is also must , as i need to do long listing.
Any alternate for this? any Suggestion.