How to recursively search for files with certain extensions?

前提是你 提交于 2019-12-03 15:14: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. Suggestions?


回答1:


You can use the following find command to do that:

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

iname does a case insensitive search.




回答2:


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)


来源:https://stackoverflow.com/questions/5985752/how-to-recursively-search-for-files-with-certain-extensions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!