script for search SUID/GUID !

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jackjill

Thread Starter
Joined
Nov 26, 2004
Messages
11
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.
 
Joined
Jan 25, 2004
Messages
74
Code:
find / -type f \( -perm -04000 -o -perm -02000 \) -exec ls -ld {} \;
Find can do all you need.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top