The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

tree - Display Directory Tree

The tree command is used to display a graphical representation of a directory tree structure. It provides a visual overview of the directory's contents, including subdirectories and files.

The syntax of the tree command is as follows:
tree [OPTIONS] [DIRECTORY] .

"DIRECTORY" represents the directory you want to view. If no directory is specified, it will display the tree structure for the current directory.
Common options for the tree command include:


Here are some examples of using the tree command:
$ tree -L 3 ←Limit the displayed directory levels to 3
$ tree -s ←Display the sizes of files and directories
$ tree ←Display the directory tree structure for the current directory
.
|-- Dektop
|-- Documents
|-- Download
|-- Music
|-- Pictures
|-- Public
|-- list_job


For more options, examples, and detailed explanations of the tree command, please refer to the provided link.