Solaris FIND: Exclude Specific Paths


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Solaris FIND: Exclude Specific Paths
# 1  
Old 08-28-2012
Solaris FIND: Exclude Specific Paths

Using Sol 10 + KSH.

I need to run a find command on the whole system "/" and exclude a bunch of explicit directories and files that may or may not be on each system.

I cannot use the -name because i dont want to exclude all dirs named just specific paths.
-path/-wholename is not an option on the Solaris FIND utility

What i have is working, but I just wanted to throw this out there and have someone else look at it to make sure I am not overlooking something and/or solicit better alternatives.

Code:
EXCLUDE=`$(ls -bdi /path/to/dir1 /path/to/dir2 /var/dir3/dir4 | sed -e 's/ *\([0-9][0-9]*\) .*/-inum \1 -o/')
find / \( $inode_matches -nouser -o -nogroup \) -prune -o -type f -print

# 2  
Old 08-28-2012
Why not grep -v?
# 3  
Old 08-28-2012
hmm i could pipe find/ through grep.

Ill try both and see which is faster
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Find command to exclude a specific path

Hi Folks, I want to run the below command and to exclude the specific path like /var/test/support/... . How to achieve using the below command find / -type f \( –perm –4000 –o –perm –2000 \) –print -Siva Please do not use FONT tags inside CODE tags. And, there is usually no reason to... (2 Replies)
Discussion started by: gsiva
2 Replies

2. Solaris

Exclude an specific directory for auditing in Solaris 10

Hello, Im glad to become a member of this forums, Im new on solaris and recentrly im introducing to use auditing service in that system. The need is, that I need how to exclude a directory to the audit service not audit it. And, a plus, I need of how to disable auditing the root user in... (0 Replies)
Discussion started by: sysh4ck
0 Replies

3. Programming

Can't find paths.h

I wasn't sure which forum to post this in. I am trying to compile logsurfer. After I run configure and the make, I get a complaint that paths.h is not found. I see three places where there is a paths.h: /usr/include/pgsql/server/optimizer/paths.h... (3 Replies)
Discussion started by: brownwrap
3 Replies

4. Solaris

exclude absolute paths when extracting Tar file?

Hi, How do I extract data from TAR excluding absolute paths for Tar? (Solaris) Thanks (3 Replies)
Discussion started by: zam
3 Replies

5. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

6. Shell Programming and Scripting

Exclude specific word from input file problem asking...

Hi, Below is my input file and desired output file: Input file: >header_N_1 ASFDGDGNDGEGWETWRYWTETWNETOWETWETWNETTETNWET . . Desired output file: >header_N_1 ASFDGDGDGEGWETWRYWTETWETOWETWETWETTETWET . . From the input file, I just hope to exclude the 'N' word from its content... (5 Replies)
Discussion started by: patrick87
5 Replies

7. Shell Programming and Scripting

Perl regular expression for exclude specific ip range

I need regular expression for excluding specific range. e.g. Input Data is 10.10.10.50 67.172.15.15 10.10.10.15 78.122.105.108 I would like to extract only 67.172.15.15 & 78.122.105.108. I tried with something like /(^10.10.10)/ but it's not working. Please help me on this (17 Replies)
Discussion started by: nrbhole
17 Replies

8. UNIX for Dummies Questions & Answers

Using find with -prune to skip a specific pathname using Solaris

I'm trying to prune out the findings of a certain directory path and have something like the following workiing on Linux (Linux 2.6.9-67.0.7.ELsmp #1 SMP x86_64): find . -path 'test/tmp' -prune -o -print I now need to have this working on sun/solaris (SunOS 5.8 Generic_117350-34 sun4u sparc... (12 Replies)
Discussion started by: antonino
12 Replies

9. UNIX and Linux Applications

CVS recursive diff -- how to exclude specific directories?

I think I've seen out there that there is a command to ignore specific files within a directory when doing a (-R) recursive diff. I've never used this so I was wondering if there was anyone who could provide an example how I would run this. My thoughts are something like: cvs diff -i <fileName1>... (2 Replies)
Discussion started by: airon23bball
2 Replies

10. UNIX for Dummies Questions & Answers

Tar Exclude Dir with a Specific Words

So here is what I got i have these directories names app-config app-exploded conf gen logs match src target currently i do: tar -cvf file.tar conf gen logs match src target What i want to do is: tar -cvf file.tar (exclude any dir with "app" in it) How can i... (1 Reply)
Discussion started by: rhartleyoh
1 Replies
Login or Register to Ask a Question