How can I find all *.js file in directory recursively in Linux?

Dmitry Belaventsev picture Dmitry Belaventsev · Jun 15, 2011 · Viewed 143k times · Source

In Linux, how can I find all *.js files in a directory recursively? The output should be an absolute path (like /pub/home/user1/folder/jses/file.js)

this answer worked for me:

find $PWD -name '*.js' > out.txt

It finds all *.js files, output absolute path, writes the results into out.txt.

Answer

e.dan picture e.dan · Jun 15, 2011

find /abs/path/ -name '*.js'

Edit: As Brian points out, add -type f if you want only plain files, and not directories, links, etc.