• sudo find /usr -type f -perm /u=s. ... find /etc -maxdepth 1 -perm /u=r.
  • Find files in the "/" directory with the "4000" permission and all the errors will stream out the /dev/null so you have a pretty output.
  • So, if we want to find all those files that hold the SUID bit then it can be retrieved by typing the command: find / -perm -u=s -type f 2>/dev/null.
  • For example, a file whose permissions are 440 would not show up in a find . -perm -200, despite the value 400 appearing to be “greater than” 200?
    • -newer file: search for the file names that are modified after “file”.
    • -perm octal: search for the files if the permission is ‘octal’.
    Linux Find -perm option.
  • 21. Find All Files with 777 Permissions and chmod to 644. $ find / -type f -perm 0777 -print -exec chmod 644 {} \
  • find - search for files in a directory hierarchy. Find SUID bit. $ find / -perm /4000 -user root -type f -ls 2>/dev/null 13501117 56...
  • You can also omit the filename to get any files of the type stated. Such as find / -perm 777 will return every file with 777 (unlimited) access.
  • To find files based on their set permissions, you will need to use the “-perm” option, followed by the numerical permission.
  • To find files that are fully accessible to any user, we use the search parameter “-perm” followed by the value “777” ... find . -perm 700.