linux find命令学习

做个笔记,没事看一看记一记,看看还记得不

# find . -name tecmint.txt

./tecmint.txt
# find /home -name tecmint.txt
/home/tecmint.txt
# find /home -iname tecmint.txt
./tecmint.txt
./Tecmint.txt
# find / -type d -name Tecmint
/Tecmint
# find . -type f -name tecmint.php
./tecmint.php
# find . -type f -name "*.php"
./tecmint.php
./login.php
./index.php
# find . -type f -perm 0777 -print
# find / -type f ! -perm 777
# find / -perm 2644
# find / -perm 1551
# find / -perm /u=s
# find / -perm /g=s
# find / -perm /u=r
# find / -perm /a=x
# find / -type f -perm 0777 -print -exec chmod 644 {} \;
# find / -type d -perm 777 -print -exec chmod 755 {} \;
# find . -type f -name "tecmint.txt" -exec rm -f {} \;
# find . -type f -name "*.txt" -exec rm -f {} \;
OR
# find . -type f -name "*.mp3" -exec rm -f {} \;
# find /tmp -type f -empty
# find /tmp -type d -empty
# find /tmp -type f -name ".*"
# find / -user root -name tecmint.txt
# find /home -user tecmint
# find /home -group developer
# find /home -user tecmint -iname "*.txt"
# find / -mtime 50
# find / -atime 50
# find / -mtime +50 –mtime -100
# find / -cmin -60(Changed) 
# find / -mmin -60(Modified) 
# find / -amin -60(Accessed)
# find / -size 50M
# find / -size +50M -size -100M
# find / -size +100M -exec rm -rf {} \;
# find / -type f -name *.mp3 -size +10M -exec rm {} \;
posted @ 2017-01-07 14:25  CHRIS-ZSY  阅读(84)  评论(0编辑  收藏  举报