Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recursively search for files with certain extensions?

Tags:

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?

like image 465
StackOverflowNewbie Avatar asked May 12 '11 23:05

StackOverflowNewbie


People also ask

Which command will recursively search for all files with extension txt?

You can use grep command or find command as follows to search all files for a string or words recursively.

How do I search for multiple file extensions in Linux?

On Linux, you can use -regex to combine extensions in a terser way. The default regexp syntax is Emacs (basic regexps plus a few extensions such as \| for alternation); there's an option to switch to extended regexps. On FreeBSD, NetBSD and OSX, you can use -regex combined with -E for extended regexps.

How do I search for files in a folder recursively?

Using Find You can also use the find command followed by the target directory and the file you wish to locate. The command will start in the root directory and recursively search all the subdirectories and locate any file with the specified name.


1 Answers

You can use the following find command to do that:

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

iname does a case insensitive search.

like image 134
onteria_ Avatar answered Jan 03 '23 10:01

onteria_