Jan 20, 2005 #1 MCubitt Programmer Mar 14, 2002 1,081 GB When I use find it searches subdirectories. How can I stop this? The -depth switch seems to be a clue but I am unsure exactly how! thanks Applications Support UK
When I use find it searches subdirectories. How can I stop this? The -depth switch seems to be a clue but I am unsure exactly how! thanks Applications Support UK
Jan 21, 2005 1 #2 sbix IS-IT--Management Nov 19, 2003 493 CA try -prune flag .... just to be sure use it only to visualize results and not in associations with other commands Upvote 0 Downvote
try -prune flag .... just to be sure use it only to visualize results and not in associations with other commands
Jan 21, 2005 Thread starter #3 MCubitt Programmer Mar 14, 2002 1,081 GB With prune I seem to get what I want, thanks. I kind of just discovered it before notification of your post arrived. So find /home/oracle/* -prune -type flbc produced: /home/oracle/err.txt /home/oracle/findlarg.txt /home/oracle/mbox /home/oracle/orapwIFSL /home/oracle/smit.log /home/oracle/smit.script PERFECT! One side issue, if the folder is empty it returns an error.. "find: 0652-019 The status on /oracledata/DB/backup/* is not valid." How does one trap this to IGNORE it. Ie, I don't care the fact it is empty but don't want to include the error in the output. thanks Applications Support UK Upvote 0 Downvote
With prune I seem to get what I want, thanks. I kind of just discovered it before notification of your post arrived. So find /home/oracle/* -prune -type flbc produced: /home/oracle/err.txt /home/oracle/findlarg.txt /home/oracle/mbox /home/oracle/orapwIFSL /home/oracle/smit.log /home/oracle/smit.script PERFECT! One side issue, if the folder is empty it returns an error.. "find: 0652-019 The status on /oracledata/DB/backup/* is not valid." How does one trap this to IGNORE it. Ie, I don't care the fact it is empty but don't want to include the error in the output. thanks Applications Support UK
Jan 21, 2005 1 #4 KenCunningham Technical User Mar 20, 2001 8,475 GB Put 2> /dev/null after your find command. Cheers. Upvote 0 Downvote
Jan 21, 2005 Thread starter #5 MCubitt Programmer Mar 14, 2002 1,081 GB Doh, thanks Ken! Applications Support UK Upvote 0 Downvote
Jan 21, 2005 #6 srisu02 Programmer Dec 29, 2004 2 IN Just curious. But why do you use 'find' when u do not want to search subdirs? Why do not u use ls (or grep instead of find . -exec) Regds, Subu Upvote 0 Downvote
Just curious. But why do you use 'find' when u do not want to search subdirs? Why do not u use ls (or grep instead of find . -exec) Regds, Subu
Jan 21, 2005 Thread starter #7 MCubitt Programmer Mar 14, 2002 1,081 GB Subu: Because it produced the continuous list with path and file name perfectly well, does LS also do this? Applications Support UK Upvote 0 Downvote
Subu: Because it produced the continuous list with path and file name perfectly well, does LS also do this? Applications Support UK
Jan 21, 2005 #8 srisu02 Programmer Dec 29, 2004 2 IN Oh true. You are right. I too used to use find for the same purpose Upvote 0 Downvote
Jan 22, 2005 #9 ogniemi Technical User Nov 7, 2003 1,041 PL I am not exactly sure (have no AIX box near me) but probably running the following you will get full paths... DIR=/home/oracle/ ls -al $DIR Upvote 0 Downvote
I am not exactly sure (have no AIX box near me) but probably running the following you will get full paths... DIR=/home/oracle/ ls -al $DIR
Jan 22, 2005 #10 ogniemi Technical User Nov 7, 2003 1,041 PL sorry, I was thinking about: ls -al $DIR/* Upvote 0 Downvote
Jan 23, 2005 #11 ggitlin MIS May 15, 2002 65 AU Also, "find" command's -xdev switch searches all sub-directories, but does not span filesystems. Upvote 0 Downvote