7.显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录
7.显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录
#显示/etc/目录下,以非字母开头的任意字符的文件或目录
[14:29:48 root@CentOS7 /etc]#ls /etc/[^[:alpha:]]* -dl
ls: cannot access /etc/[^[:alpha:]]*: No such file or directory
[14:29:51 root@CentOS7 /etc]#touch 2ef.log
[14:30:52 root@CentOS7 /etc]#mkdir 77882ef
[14:53:18 root@CentOS7 /etc]#touch 1xi96.haha
[14:56:19 root@CentOS7 /etc]#ls /etc/[^[:alpha:]]* -dl
-rw-r--r--. 1 root root 0 Apr 5 14:53 /etc/1xi96.haha
-rw-r--r--. 1 root root 0 Apr 5 14:30 /etc/2ef.log
drwxr-xr-x. 2 root root 6 Apr 5 14:31 /etc/77882ef
最终结果:
[14:56:49 root@CentOS7 /etc]#ls /etc/ | grep ^[^[:alpha:]][[:alpha:]].* …………….只显示文件
1xi96.haha
2ef.log
[15:00:27 root@CentOS7 /etc]#ls /etc/ | grep ^[^[:alpha:]][[:alpha:]]*.* ………目录文件都显示
1xi96.haha
2ef.log
77882ef