How to display only the "found" file names in this scenario:
Code:
[demo@localhost Perl]$ find . -mtime -17 -exec "file" \{\} \;
.: directory
./hi: empty
./try.pl: a /usr/bin/perl script text executable
./hey.pl: a /usr/bin/perl script text executable
Code:
[demo@localhost Perl]$ find . -mtime -17 -exec "ls -l" \{\} \;
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
Code:
[demo@localhost Perl]$ find . -mtime -17 -exec 'ls -l' \{\} \;
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
find: `ls -l': No such file or directory
[demo@localhost Perl]$
?
I am trying to long-list the names of the files which have been created or otherwise modified / changed during the last 17 days.
Code:
[demo@localhost Perl]$ find . -mtime -17 -print | xargs 'file'
.: directory
./hi: empty
./try.pl: a /usr/bin/perl script text executable
./hey.pl: a /usr/bin/perl script text executable
Code:
[demo@localhost Perl]$ find . -mtime -17 -print | xargs 'ls -l'
xargs: ls -l: No such file or directory
I seem to have forgotten the correct syntax.
I do have a way to do that, though:
Code:
[demo@localhost Perl]$ ls -ltr | grep -w Sep | awk '{if($7 >=2) print $0}'
-rw-rw-r--. 1 demo demo 125 Sep 9 10:25 hey.pl
-rwxr-xr-x. 1 demo demo 72 Sep 9 14:55 try.pl
-rw-rw-r--. 1 demo demo 0 Sep 26 04:56 hi
[demo@localhost Perl]$