Excluding node_modules when using tree command on Mac

Last updated on May 28, 2020 A Goodman Loading... Post a comment

The node_modules folder is often super big and contains countless files and subdirectories. Therefore, when using the tree command to display your project structure, you should ignore node_modules. To do so, try this:

tree -I 'node_modules'

The result:

If you want the command to exclude more than one directory, you can use:

tree -I 'folder-1|folder-22|folder-3|folder-4'

Simple as that. Hope this short article can help you a little bit in some way.

Related Articles

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x