linux find regex

前端 未结 4 579
[愿得一人]
[愿得一人] 2021-01-30 03:49

I\'m having trouble using the regex of the find command. Probably something I don\'t understand about escaping on the command line.

Why are these not the sa

4条回答
  •  一整个雨季
    2021-01-30 04:35

    Note that -regex depends on whole path.

     -regex pattern
                  File name matches regular expression pattern.  
                  This is a match on the whole path, not a search.
    

    You don't actually have to use -regex for what you are doing.

    find . -iname "*[0-9]"
    

提交回复
热议问题