File Search

Find

find / -name 'filename.txt'                     
>> search with filename

find / -iname 'filename.txt'                         
>> Case-insensitive search

find / -perm -4000                              
>> specific permission files for user

find / -perm -4000 -o -perm -2000 2> /dev/null        

-u = user , -g = group , -o = others                  
>> specifing parameters

find /dir -xdev -perm +o=w ! \( -type d -perm +o=t \) ! -type l -print
>> world writable files

find / -type f -writable
>> search writable files

find / -type f -executable
>> search executable files

find / -user john                                      
>> specific user files

find / -group developers                               
>> specific group files

find / -user john -or -group developers                
>> combining user & group

-or , -and , -not                                     
>> combining parameters

find / -type f                                        
>> f = file , d = directory

find / -name abc -exec {/bin/bash} \;
>> privesc

find . -name index.html -exec rm {} \;
>> remove file 

Last updated