How to recursively search for files with certain extensions?

前端 未结 2 1072
别跟我提以往
别跟我提以往 2020-12-31 01:02

I need to find all the .psd files on my Linux system (dedicated web hosting). I tried something like this: ls -R *.psd, but that\'s not working. Su

相关标签:
2条回答
  • 2020-12-31 01:37

    You can use the following find command to do that:

    find /path/to/search -iname '*.psd'
    

    iname does a case insensitive search.

    0 讨论(0)
  • 2020-12-31 01:46

    you also can

    ls ./**/*.psd
    

    but:

    • you must have bash version 4+
    • you must have shopt -s globstar #in your .bashrc or .profile, etc....
    • will search case sensitive (or you must set shopt -s nocaseglob too)
    0 讨论(0)
提交回复
热议问题