I am trying to locate if these libraries are on my machine or not. find command runs for about few seconds and hangs after this.
Can someone please help me and let me know if there is a better way. Is there a way I can ignore a directory and its sub directories during the find process
find: cannot read dir /ssttools/performance/RMCmem: Permission denied
$ for i in `cat library`
do
find / -name $i -print | grep $i >> outputfile
done
find: cannot read dir /proc/24250: Permission denied
find: cannot read dir /proc/17502: Permission denied
find: cannot read dir /tmp/smc898: Permission denied
find: cannot read dir /tmp/config_pvr: Permission denied
find: cannot read dir /export/home/dwgore/.rhosts: Permission denied
find: cannot read dir /export/home/mgalvin/.rhosts: Permission denied
find: cannot read dir /export/home/nmsbb/.ssh: Permission denied
find: cannot read dir /export/home/www/.ssh: Permission denied
find: cannot read dir /ssttools/performance/RMCmem: Permission denied
It is taking a lot of time here before it can go to next
There are few directories which I want the find command to skip or ignore and move on. How do I modify the find command so that it skips these directories
find: cannot read dir /export/home/www/.ssh: Permission denied
find: cannot read dir /ssttools/performance/RMCmem: Permission denied
find: cannot read dir /ssttools/tng/focus: Permission denied
-path pattern
File name matches shell pattern pattern. The metacharacters do not treat �/' or �.' specially; so, for
example,
find . -path './sr*sc'
will print an entry for a directory called './src/misc' (if one exists). To ignore a whole directory tree,
use -prune rather than checking every file in the tree. For example, to skip the directory �src/emacs' and
all files and directories under it, and print the names of the other files found, do something like this:
find . -path './src/emacs' -prune -o -print
How about a situation where you only want to find all regular files, but omit certain directories? Eg, i tried:
find . -name 'dir1' -prune -o name 'dir2' -prune -o type f
And the above does give me just regular files, except i get an entry for 'dir1' and 'dir2'; even though none of the files underneath these directories appear in the final list (which is what i want). I also want to omit the 'dir1' and the 'dir2' entries. They're the only things that show up in my output that are not regular files.