Summary of common shell commands -tree

What is the tree command?

Tree command A shell command that is installed through brew Install tree on the Mac platform. After installation can be in the terminal iTerm2

Presents a beautiful and concise directory structure for demonstration and sharing.

Two, how to use

General usage: tree [parameter]

The following is an example:

$ tree

$ tree src

# level 1 directory, excluding node_moduels
$ tree . -L 1 -I node_modules
Copy the code

Common parameters are as follows:

Parameter names instructions
-L level Show directory hierarchy
-C According to the color
-d Show directories only
-f Display the full path
-s Size Displays the volume
-I Rule out directory

More detailed documentation is available using man Tree.