美文网首页
shell-通配符

shell-通配符

作者: 哆来咪发都不会 | 来源:发表于2019-08-13 18:23 被阅读0次
    *:通配
    ?:一个字符
    [0-4]:0-4之间的5个数字.
    [0-9a-z]:所有数字、所有字母(不区分大小写).
    [123213]:括号中的任意一个数字.
    {1,2,3,a}:括号中的任意一个.
    
    实例
    [root@localhost wang]# ls
    123.txt  1.txt  23.txt  2.txt  3.txt  a.txt  A.txt
    
    [root@localhost wang]# ls *.txt
    123.txt  1.txt  23.txt  2.txt  3.txt  a.txt  A.txt
    
    [root@localhost wang]# ls ?.txt
    1.txt  2.txt  3.txt  a.txt  A.txt
    
    [root@localhost wang]# ls [0-4].txt
    1.txt  2.txt  3.txt
    
    [root@localhost wang]# ls [0-9a-z].txt
    1.txt  2.txt  3.txt  a.txt  A.txt
    
    [root@localhost wang]# ls [12332121].txt
    1.txt  2.txt  3.txt
    
    [root@localhost wang]# ls {1,2,3,a}.txt
    1.txt  2.txt  3.txt  a.txt
    

    相关文章

      网友评论

          本文标题:shell-通配符

          本文链接:https://www.haomeiwen.com/subject/fdnbjctx.html