您的位置:首页 > 运维架构 > Linux

linux find命令学习

2017-01-07 14:24 399 查看
做个笔记,没事看一看记一记,看看还记得不

# 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 {} \;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: