Linux Comm Tree
# Linux tree command
[ Linux Command Manual](#)
The Linux tree command is used to list the contents of a directory in a tree-like diagram.
Executing the tree command will list all files in the specified directory, including files in subdirectories.
### Syntax
tree [directory...]
**Parameter Description**:
* -a Display all files and directories.
* -A Use ANSI graphic characters to display the tree diagram instead of ASCII character combinations.
* -C Add color to the file and directory listing to easily distinguish different types.
* -d Display directory names instead of contents.
* -D List the modification time of files or directories.
* -f Display the full relative path name before each file or directory.
* -F Append "*", "/", "=", "@", "|" to executable files, directories, Sockets, symbolic links, and pipes respectively.
* -g List the group name of files or directories. If no corresponding name exists, display the group ID.
* -i Do not list file or directory names in a hierarchical manner.
* -L level Limit the directory display level.
* -l If encountering a directory that is a symbolic link, directly list the original directory pointed to by the link.
* -n Do not add color to the file and directory listing.
* -N Directly list file and directory names, including control characters.
* -p List permission indicators.
* -P Only display file or directory names that match the pattern.
* -q Use "?" to replace control characters when listing file and directory names.
* -s List file or directory size.
* -t Sort by the modification time of files and directories.
* -u List the owner name of files or directories. If no corresponding name exists, display the user ID.
* -x Limit the scope to the current file system. If some subdirectories under the specified directory are located on another file system, exclude those subdirectories from the search scope.
### Example
List the current directory structure in a tree diagram. You can directly use the following command:
tree
This command produces the following output:
# tree #List the current directory structure in a tree diagram . #Current directory structure |-- README |-- examples.desktop |-- file |-- file.new |-- index.htm |-- test | |-- README | |-- file | |-- testfile | |-- testfile1 | |-- xaa | |-- xab | |-- xac | |-- xad | |-- xae | |-- xaf | |-- xag | |-- xah | `-- xai |-- test.tar.gz |-- test.zip |-- testfile |-- testfile.new |-- testfile.patch |-- testfile1 |-- testfile2 |-- testfile3 |-- xaa |-- xab |-- xac |-- xad |-- xae |-- xaf |-- xag |-- xah |-- xai |-- 345205254345205261347232204 |-- 345233276347211207 | |-- 075b5c2bb1628c1a5343c10a.jpg | |-- 0c978fe989ac787e799757095719d3c4.jpg | |-- 20050726194826866443.jpg | |-- 20061113171548785122.jpg | |-- 2007102221576687.jpg | |-- 39.jpg | |-- 434887ec4340916a78f0559a.jpg | |-- 498da016ac02fb2bc93d6d08.jpg | |-- 7b284f5a0f854da2f3bf90b204149a34.jpg | |-- 9196c030d342a68d5edf0e98.jpg | |-- a56c5a90de15c8a9a977a4cc.jpg | |-- c74f62167c9d2b244a90a79e.jpg | `-- img13.jpg |-- 346226207346241243 |-- 346241214351235242 |-- 346250241346235277 |-- 350247206351242221 `-- 351237263344271220 8 directories, 48 files #Statistical information, this directory has 8 subdirectories and 48 files
[ Linux Command Manual](#)
YouTip