Search code examples
unixgrepfindnew-operator

Specific file name search UNIX


Hello i am new with UNIX and needed help with my search. I need to find a file that starts with 'f' than has unknown number of numbers then has 'gr' and ends with large letters also unknown number and unknown extension. ex. f123456grKNI, f11223grKE

Thank you up front


Solution

  • With gnu find, you can try

    find . -regextype posix-extended -regex '.*/f[0-9]+gr[A-Z]+\.?.*'