I use following find command to find and show all files having the input text pattern.
find . -type f -print|xargs grep -n ‘pattern’
I have many project folders each of which has its own makefile named as ‘Makefile’.(no file extension, just ‘Makefile’)
How do i use above command to search for a certain pattern only in the files named Makefile which are present in all my project folders?
-AD.
-printis not required (at least by GNUfindimplementation).-nameargument allows to specify filename pattern. Hence the command would be:find . -name Makefile | xargs grep pattern