Search for string in files with specific extension and return full paths

Command:

grep -rl --include="*.js" "searchString" ${PWD}

Returned output:

/root/test/bas.js
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp