linux 中查找隐藏文件及排除隐藏文件
001、查找当前目录下的隐藏文件
[root@PC1 test01]# ls a.txt dir1 [root@PC1 test01]# ls -a . .. a.txt dir1 .x.txt [root@PC1 test01]# find ./ -maxdepth 1 -type f -name ".*" ## 查找当前目录下的隐藏文件 ./.x.txt
002、排除当前目录下的隐藏文件
[root@PC1 test01]# ls a.txt dir1 [root@PC1 test01]# ls -a . .. a.txt dir1 .x.txt [root@PC1 test01]# find ./ -maxdepth 1 -type f -not -name ".*" ## 排除当前目录下的隐藏文件 ./a.txt
。