Find

La commande peut être vraiment puissante

# find all directories (recursively), and give the owner the permission
# to read, write and execute
find /usr/local/nagios/etc/ -type d -exec chmod u+rwx {} ;
# find all directories (recursively), and remove all right to
# group members and the rest of the world
find ./ -type d -exec chmod og-rwx {} ;
# find all files (recursively), and give the owner the permission
# to read, write but not execute
find ./ -type f -exec chmod u+wr-x {} ;
# find all files (recursively), and remove all right to
# group members and the rest of the world
find ./ -type f -exec chmod og-rwx {} ;

Recherche de tous les fichiers ou répertoires avec un bit SUID ou SGID activé

sudo find / -user root -perm +7000 -exec ls -l {} \; > /home/olivier/Desktop/install-specialbits.txt
sudo find / -perm +7000 -exec ls -l {} \; > /home/olivier/Desktop/`date +%Y-%m-%d_specialbits.txt`
cmd/find.txt · Dernière modification: 16/01/2012 14:21 (modification externe)
 
Sauf mention contraire, le contenu de ce wiki est placé sous la licence suivante : CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki