FANDOM



Creating a list of all the files in a directory with a certain extensionEdit

For example, say I wanted to find all of the JavaScript files in a directory and its children and make a list of them. I could do it this way:

find my_dev_directory -name "*.js" > myJsList.txt

The `find' command will traverse *down* the directory tree you give it (unless you specify otherwise), so if there is a file ending in '.js' in "my_dev_directory/my_super_project/jsfiles", or "my_dev_directory/super_secret", it'll find it and it'll be added to the list.

Use >> if you want to append to a file you've already created. This is handy if you decided you want all of the .rb and .js files, but not the .html or .css files (you could initially use *.* in that case).

To do this quicker/dirtier, say if I wanted to see every file in my working directory that had the string "learn" in it, I could

echo *learn*.*

using wildcards for the bounding text and the extension.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.