script/command needed to list down all header files (.h files) in a directory (recursively) script/command needed to list down all header files (.h files) in a directory (recursively) unix unix

script/command needed to list down all header files (.h files) in a directory (recursively)


find . -name "*.h"

for just the paths in the current dir and below. And if you can live with repeating the filename, and assuming I understood what you want as output, this is the more complex version...

find . -name "*.h" | while read i; do echo $(basename "$i") "$i"; done | sort