[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Puzzel Soalris command structure

Posted on 2011-10-26
7
Medium Priority
?
251 Views
Last Modified: 2012-05-12
Hi All,

   I have a problem, a real puzzle!!

     This has to do with the FIND command specifically on SOLARIS.   Normally I could use alternatives
Like the GNU find or find2perl but in this case I have specific constraint I have to stay with the native
SUN find command

 Here is the problem:     this is a basic find command to look for world writable file and  excluding some dir
From the search path.  The problem with this is that if someone creates a file or dir like  /opt/dev it will also be exclude
And we don’t want that.  To add to the problem this will be run on over 1000 servers within another app

So anyone has idea on how I could build this command.

 find  / -name /proc -prune \
     -o -name /sys -prune \
     -o -name /dev -prune \
     -o -name /devices -prune \
     -o -perm -2 ! -type l  ! -type s \
     ! \( -type d -perm -1000 \) -ls
0
Comment
Question by:d_asselin
  • 4
  • 3
7 Comments
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 2000 total points
ID: 37034775
Try this
find  /proc /sys /dev-name /proc devices -perm -2 -not -type l  -not -type s -not -type d -not -perm 1000

Open in new window

0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 2000 total points
ID: 37034780
Sorry this one.  Let me know.
find  /proc /sys /dev /proc devices -perm -2 -not -type l  -not -type s -not -type d -not -perm 1000

Open in new window

0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 2000 total points
ID: 37034783
Typo again
find  /proc /sys /dev /proc /devices -perm -2 -not -type l  -not -type s -not -type d -not -perm 1000

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Assisted Solution

by:d_asselin
d_asselin earned 0 total points
ID: 37037459
  I don’t think so.  Solaris doesn’t support  the –not.
Nice try I had never seen the –not option in a find command

find  /proc /sys /dev /proc /devices -perm -2 -not -type l  -not -type s -not -type d -not -perm 1000
find: bad option -not
find: [-H | -L] path-list predicate-list
[08:46 0.04]
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 2000 total points
ID: 37037475
Then use ! instead of -not.  Does that work?
0
 

Accepted Solution

by:
d_asselin earned 0 total points
ID: 37037535
Ok let’s get back to the scope of the questions.

 I need to scan 1400 Solaris servers of different flavors Sol 8 9 10  So I<m very very limited
On the tools I can use.

So the Native Sun tool is all I have.   The Scan has to scan all of the file systems excluding
Some system dir like /dev ,  /devices. The standard find will do that with no problem.   But
What the standard find will not do is discriminate between  /dev  and /opt/dev if some one
Created it.  Because the function –path is not supported in that version of find

I hope this helps explain what I’m looking for, I’m not even shure it is possible
Dan
0
 

Author Closing Comment

by:d_asselin
ID: 37068327
No good answers are possible
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question