find

From Initq
Jump to: navigation, search


Find files and directories.

Directories and Files

[root@localhost ~]# mkdir hello
[root@localhost ~]# find . -type d 
.
./hello
[root@localhost ~]# find . -type f
./.viminfo
./.bashrc
./install.log.syslog
./.Xauthority
./.tcshrc
./anaconda-ks.cfg
./.cshrc
./.bash_logout
./.bash_profile
./install.log
./.bash_history

Check setuid and setgid

This is done by

  • chmod 2755 or g+s (will give group s)
  • chmod 4755 or u+s (will give user s)
[root@localhost ~]# find / -perm +6000 -type f -exec ls -ld {} \; > setuid.txt &

Once you find some file and wantto take off the setuid and setgid then do

  • chmod a-s <file>
Personal tools