Bash基本功能--通配符与其他特殊符号

 

[root@localhost tmp]# ls   //当前目录下有四个文件

0abc   123   abc   abcd

[rootelocalhost tmp]# ls *abc   //匹配abc本身和它前面有一位字符的文件

0abc abc

[rootelocalhost tmp]# ls *abc*  //匹配abc本身和它前后有一位字符的文件

0abc abc abcd

[rootelocalhost tmp]# ls ?abc   //匹配abc前有任意字符的文件

0abc

[rootelocalhost tmp]# ls [0-9]abc   //abc前面有一个数字符号的文件

0abc

[rootelocalhost tmp]# ls [^0-9]abc  //abc前面有一个非数字符号的文件

 

原文地址:https://www.cnblogs.com/xbycf/p/12403489.html