Detailed description of tree commands under inux --- commands for listing contents in a tree chart in linux ######################## ######################################## ############ command format tree & lt; option or parameter & gt; & lt; partition or directory & gt; ######################################## #
Detailed description of tree commands under inux-commands for listing directories in a tree chart in linux
######################################## #####################################
Command format
Tree <选项或者是参数> <分区或者是目录>
######################################## #####################################
(1) the longest-used tree parameter or option
-A: displays all files and directories.
[Root @ liyao ~] # Tree-
.
| --. Bash_logout
| --. Bash_profile
| --. Bashrc
| --. Cshrc
| --. Gconf
| '-- Apps
| -- % Gconf. xml
| '-- Gnome-session
| -- % Gconf. xml
| '-- Options
| '-- % Gconf. xml
| --. Gconfd
| '-- Saved_state
| --. Tcshrc
| -- Anaconda-ks.cfg
| -- Install. log
'-- Install. log. syslog
**************************************** **************************************** ******
-D: displays the directory name rather than the content.
[Root @ liyao ~] # Tree-d
.
'-- Liyao
1 directory
**************************************** *************************************
-F displays the complete relative path name before each file or directory.
[Root @ liyao ~] # Tree-f
.
| --./Anaconda-ks.cfg
| --./Install. log
| --./Install. log. syslog
'--./Liyao
1 directory, 3 files
**************************************** *************************************
-F adds "*", "/", "=", "@", "|" to the execution file, directory, Socket, symbolic connection, and MPs queue name.
[Root @ liyao ~] # Tree-F
.
| -- Anaconda-ks.cfg
| -- Install. log
| -- Install. log. syslog
'-- Liyao/
1 directory, 3 files
**************************************** *************************************
-R in reverse order
[Root @ liyao ~] # Tree-r
.
| -- Liyao
| -- Install. log. syslog
| -- Install. log
'-- Anaconda-ks.cfg
1 directory, 3 files
**************************************** *************************************
-T sort by the change time of files and directories.
[Root @ liyao ~] # Tree-t
.
| -- Liyao
| -- Anaconda-ks.cfg
| -- Install. log
'-- Install. log. syslog
1 directory, 3 files
[Root @ liyao ~] # Ls-l
Total 56
-Rw ------- 1 root 1012 Jul 3 anaconda-ks.cfg
-Rw-r -- 1 root 27974 Jul 3 21:43 install. log
-Rw-r -- 1 root 4708 Jul 3 21:43 install. log. syslog
Drwxr-xr-x 2 root 4096 Jul 3 23:30 liyao
**************************************** *************************************
-L n: only the n-layer directory is displayed (n is a number)
[Root @ liyao ~] # Tree-L 2
.
| -- Anaconda-ks.cfg
| -- Install. log
| -- Install. log. syslog
'-- Liyao
'-- Baobao
2 directories, 3 files
**************************************** *************************************
-- The dirsfirst directory is displayed after the previous file.
[Root @ liyao ~] # Tree -- dirsfirst
.
| -- Liyao
| '-- Baobao
| -- Anaconda-ks.cfg
| -- Install. log
'-- Install. log. syslog
2 directories, 3 files
######################################## #############################
(2) parameters that can be added, but not frequently used
-A uses ASNI plot characters to display tree charts instead of ASCII character combinations.
-C adds colors to the file and directory list to distinguish between different types.
-D: list the change time of a file or directory.
-G lists the group names of files or directories. If no corresponding name exists, the group ID is displayed.
-I does not list file or directory names in steps.
-I does not display the name of the file or directory that meets the template style.
-L if a directory with a symbolic connection is encountered, the original directory pointed to by the connection is directly listed.
-N does not add colors to the file and directory list.
-N: directly lists the file and directory names, including control characters.
-P: list the permission IDs.
-P only displays the names of files or directories that conform to the template style.
-Q: use "? "To replace the control character to list the file and directory names.
-S: list the file or directory size.
-U indicates the name of the owner of a file or directory. If no corresponding name exists, the user ID is displayed.
-X limits the range to the current file system. if some subdirectories in the specified directory are stored in another file system, this subdirectory is excluded from the search range.