cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Commander Commander
Commander
  • 217 Views

find Command

For the RHCSA-level audience only:

 

What does the following command do:

find   /   -type f   -a \( -perm -u+s -o -perm -g+s \)   -exec ls -l {} \;   2> /dev/null

 

Simple answer is best!!!

Trevor "Red Hat Evangelist" Chandler
Labels (3)
4 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 163 Views

@Trevor Let me give a reverse engineering hint or something that learners can relate this answer to :

"On a Linux system, how can you generate a comprehensive list of all regular files in the filesystem that have the SUID or SGID (set-user-ID or set-group-ID) bit set, along with their detailed file-permission, owner/group and path information - while suppressing error messages such as “permission denied”?"

Trevor
Commander Commander
Commander
  • 47 Views

Reverse engineering - a very nice approach!!!

Thanks Chetan!!!!

Trevor "Red Hat Evangelist" Chandler
Sunnykumar1
Flight Engineer
Flight Engineer
  • 154 Views

Hello @Trevor 

It shows all SUID/SGID files on the system with detailed listing.

Any error messages (like "permission denied") are hidden (2> /dev/null).

You may refer to the below screenshot:

Sunnykumar1_1-1765225976468.png

 

 

Trevor
Commander Commander
Commander
  • 47 Views

Thanks Sunnykumar1 for weighing in!!!

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.