Игнорировать несколько папок, используя дерево

1217
Jon

Команда tree -I 'node_modules'предотвращает node_modules folderпоявление в выводе. Аналогично, tree -I 'app/ui/bower_components'предотвращает app/ui/bower_componentsпоявление на выходе.

Однако, tree -I 'node_modules' -I 'app/ui/bower_components'не препятствует тому, чтобы оба появились в выводе. Вместо этого кажется, что используется последний.

Итак, как вы игнорируете использование нескольких папок tree?

3

1 ответ на вопрос

4
Marlun

You can use | to separate patterns, in your example you can do

tree -I "node_modules|bower_components" 

You need the double quotation marks so that bash won't interpret the pipe character.

If you look at the man pages for tree, read the one for the -P argument instead of the -I (just above).

Похожие вопросы