Explain the use of tree command under Linux


Tree command, the main function is to create a list of files, all files listed in the form of a tree

Tree under Linux is more powerful, but the general system does not have this command, it needs to be downloaded and installed manually.


yum -y install tree


– a Displays all files and directories.

– A Use ASNI drawing characters to display a tree instead of ASCII character combinations.

– C adds color to the list of documents and directories to facilitate the distinction of various types.

– D Displays the directory name, not the content.

– D lists the change times of files or directories.

– F Displays the complete relative path name before each file or directory.

– F adds’*’, /’, =’,’@’,’|’to the execution files, directories, Sockets, symbolic connections, and pipe names.

– G lists the group names of the files or directories to which they belong, and if there is no corresponding name, the group identification code is displayed.

– I do not list file or directory names in a ladder.

– I does not display a template-style file or directory name.

– If you encounter a directory that is a symbolic connection, list directly the original directory to which the connection refers.

– N does not add color to the list of files and directories.

– N directly lists file and directory names, including control characters.

– P lists permission labels.

– P displays only file or directory names that conform to the template style.

– Q replaces the control character with a “?” number, listing the names of files and directories.

– s lists file or directory sizes.

– t is sorted by the change time of files and directories.

– U lists the name of the owner of a file or directory, and if there is no corresponding name, the user identification code is displayed.

– x limits the scope to the existing file system. If some subdirectories in the specified directory are stored on another file system, the subdirectory is excluded from the search scope.


Above is the usage of tree command under Linux introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support to developpaer.