Linux – How to find a specific file in a directory tree


Could someone please help me to find all the *.c and *.h files in a directory tree??

Best Answer

find . -name '*.[ch]' -type f 

*.[ch] represents all *.h and *.c files, -type f finds regular files.

P.S. You might want to accept answers for your other questions :)