script for search SUID/GUID !

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 3
Reputation: jackjill is an unknown quantity at this point 
Solved Threads: 0
jackjill jackjill is offline Offline
Newbie Poster

script for search SUID/GUID !

 
0
  #1
Feb 1st, 2005
Hi guys,
i'm trying to write a script for following purpose.

shell program will be used by Linux/Unix sysadmins to search for
SUID/SGID files. The default directory to search is the present
working directory, however, the user may include a directory name on
the command line as an alternative. Also, if the user includes the
argument '-R' then the search should include all subdirectories
recursively. Also, the '-G' argument will include SGID files which by
default are not shown. The output of the script should show the
absolute pathname of the file and the owner.


Please help me in performin such task.

i'm trying using this line:

ls -l | awk '{print $1}' | grep s
it just prints the permissions having s bit.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 3
Reputation: Durai is an unknown quantity at this point 
Solved Threads: 0
Durai Durai is offline Offline
Newbie Poster

Re: script for search SUID/GUID !

 
0
  #2
Feb 3rd, 2005
Hi,

Here is you want:

$ ls -l `find /tmp -name tt` | awk '$1 = "s" { print $9 " " $3 }'

/tmp/Test/Test/tt root

You can give the input dirrecotry in find command instead of /tmp.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC