The Linux Tree command is used to list the contents of a directory in a tree view.
Executes the tree instruction, which lists all files in the specified directory, including files in subdirectories.
Grammar
Tree [-aacddffgilnnpqstux][-i < template style >][-p < template style >][directory ...]
parameter Description :
-a displays all files and directories. -A uses Asni drawing characters to display a tree instead of an ASCII character combination. -C adds color to the list of files and directories, making it easy to differentiate between types. -D Displays the directory name instead of the content. -D lists the time that the file or directory was changed. -F Displays the full relative path name before each file or directory. -F in executing files, directories, sockets, symbolic connections, pipe name names, respectively plus "*", "/", "=", "@", "|" No. -g lists the name of the group to which the file or directory belongs, and when there is no corresponding name, the group identifier is displayed. -I does not list the file or directory name in a ladder form. -i< template style > does not display file or directory names that conform to the template style. -L If you encounter a directory with a symbolic connection, directly list the original directory that the connection points to. -N does not add color to the list of files and directories. -N lists file and directory names directly, including control characters. -p lists the permission marks. -p< template style > show only file or directory names that conform to the template style. -Q with "?" control characters, listing file and directory names. -s lists the file or directory size. -T is sorted with file and directory change times. -U Lists the owner name of the file or directory, and the user ID is displayed when there is no corresponding name. -X limits the scope to the current file system, and if some subdirectories under the specified directory reside on another file system, the subdirectory is excluded from the search scope.
Instance
Lists the current directory structure in a tree-like chart. You can use the following command directly:
Tree
Common usage:
Tree-a Show All
Tree-d Show only Directories
Tree-l n N Represents the number: Indicates how many layers to display ...
TREE-F Displays the full path:
Of course the tree supports redirection to files ...
Tree-l 4 >dirce.doc to generate documents in UTF8 format ... We can also view it under Windows:
Note: The generated TXT or other files are garbled when opened under win ... At this point we want to select the character encoding for UTF-8. Of course.. UTF-8 is your default character set under Linux to ...
Linux Tree Command