Options: -V, --version output the version number -a, --all-files All files, include hidden files, are printed. --dirs-first List directories before files. -d, --dirs-only List directories only. -I, --exclude [patterns] Exclude files that match the pattern. | separates alternate patterns. Wrap your entire pattern in double quotes. E.g. `"node_modules|coverage". -L, --max-depth <n> Max display depth of the directory tree. -r, --reverse Sort the output in reverse alphabetic order. -F, --trailing-slash Append a '/' for directories. -h, --help output usage information
tree -d 只显示文件夹;
tree -L n 显示项目的层级。n表示层级数。比如想要显示项目三层结构,可以用tree -l 3;
tree -I pattern 用于过滤不想要显示的文件或者文件夹。比如你想要过滤项目中的vendor文件夹,可以使用tree -I “vendor”;