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

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.


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

编辑:正如布莱恩指出的那样,如果你只需要纯文件,而不是目录,链接等,就加上-type f


在命令行上使用find

find /my/directory -name '*.js'

If you just want the list, then you should ask here: http://unix.stackexchange.com

The answer is: cd / && find -name *.js

If you want to implement this, you have to specify the language.

链接地址: http://www.djcxy.com/p/78336.html

上一篇: 丢失httpd.conf文件位于apache

下一篇: 如何在Linux中以递归方式查找目录中的所有* .js文件?