|
要在当前目录下找出所有以conf为后缀名的文件,用
[root@drive4 etc]# find ./ -type f -name *.conf
find: paths must precede expression
Usage: find [path...] [expression]
不行,要用引号引起来才行:
[root@drive4 etc]# find ./ -type f -name "*.conf"
./modules.conf
./host.conf
./nsswitch.conf
./ld.so.conf
....
但是如果是查找其他后缀名的文件,不用引号也可以:
[root@drive4 etc]# find ./ -type f -name *.sh
./profile.d/glib2.sh
./profile.d/colorls.sh
./profile.d/less.sh
./profile.d/which-2.sh
试了很多后缀名, *.conf , *conf, *config 一定要用引号才行(或者还有其他更多),其他字母组合就可以不用引号,为什么?难道find命令专门对config文件做了限制? |
|