kindly eliminate the space in bold below and put "/" instead...
find /lcl/apps/Tivoli/omnibus_procedure_scripts/*.sh -mtime +1 2>/dev/null
the usage of 2>/dev/null is to redirect the error to /dev/null.
is "omnibus_procedure_scripts" a file or directory name?
---------- Post updated at 03:54 AM ---------- Previous update was at 03:53 AM ----------
Still not sure I am getting what I am after....
I need to search only the directory I am in for any .arc files (no sub directories) and I need to turn the results into a count.
It seems like the find command works in the current directory but also drills into all sub directories.
So for example if there was 3 files with the ext .arc then the results returned would be 3.
That way I can look at the result number to see if any were found.
Also I am using this on Solaris and Linux so I am not sure if the commands would be the same.
if you put the syntax like below you will search the current directory only.
find /path/of/the/directory/*.arc -mtime +1 2>/dev/null
^^^^ #file name
if you write the syntax like below you will search the directory and its sub-directory
find /path/of/the/directory -name "*.arc" -mtime +1 2>/dev/null
^^^^ #file name
Ok I see what you mean now
Yes that does seem to work. Now how would I turn that into a count though for the output? For example if it does find a .sh file.
For example if there are 3 files in that directory...
file1.pl
file2.sh
file3.pl
And I do the command it should come back with a result of
1
Because there was only 1 file with a .sh ext. If there are none then it should result in a 0 for the output.
Thanks again for the help.
---------- Post updated at 04:28 AM ---------- Previous update was at 04:24 AM ----------
Ok I think its close....
kraken:/lcl/prd/data/entp/archives>find /lcl/prd/data/entp/archives/*.arc -mtime +1 2>/dev/null | wc -l
0
Only thing is why does the 0 show up so much to the right on Solaris?