Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 743 Bytes

10.通配符.md

File metadata and controls

21 lines (16 loc) · 743 Bytes

通配符

find

sudo find /home/one/ -name '*text*':寻找文件名称带text的文件
sudo find /home/one/ -name 'te*':寻找文件开头名称带te的文件
* 匹配任意字符串
? 匹配任意单个字符
[] 匹配[]内字符,可以按,-区分,也可无符号区分
! 匹配非!后的字符串中的每一个字符 一般配合[]使用
sudo find . -name "text.t?t":?表示任意一个字符
sudo find . -name "text.t[a,b]t":只是匹配a,b两个字符串的词语
sudo find . -name "text.t[!a,b]t":不匹配a,b中的词语