CentOS Tree Command detailed

Source: Internet
Author: User
Tags control characters syslog

Inux the tree command in detail---Linux to list the contents of the directory hierarchically
#############################################################################
Command format
Tree < options are either parameters > < partitions or directories >
#############################################################################
(1) tree longest use parameter or option

-a displays all files and directories.
[Root@liyao ~]# tree-a
.
|--. bash_logout
|--. bash_profile
|--. BASHRC
|--. CSHRC
|--. gconf
| '--apps
| |--%gconf.xml
| '--gnome-session
| |--%gconf.xml
| '--options&NBSP;
|               '--%gconf.xml&NBSP;
|--. Gconfd&NBSP;
|   '-- Saved_state&NBSP;
|--. Tcshrc 
|--anaconda-ks.cfg&NBSP;
|--Install.log &NBSP;
'--install.log.syslog 
**************************************************************************************
-D displays the directory name instead of the content. &NBSP;
[Root  @liyao ~]# tree-d< Span class= "Apple-converted-space" >&NBSP;
. '--Liyao

1 directory

*****************************************************************************
-F Displays the full relative path name before each file or directory.
[Email protected] ~]# tree-f
.
|--./anaconda-ks.cfg
|--./install.log
|--./install.log.syslog
'--./liyao
1 directory, 3 files
*****************************************************************************
-F in executing files, directories, sockets, symbolic connections, pipe name names, respectively plus "*", "/", "=", "@", "|" No.
[Email protected] ~]# tree-f
.
|--anaconda-ks.cfg
|--Install.log
|--Install.log.syslog
'--liyao/

1 directory, 3 files
*****************************************************************************
-R arranged in reverse order
[Email protected] ~]# tree-r
.
|--Liyao
|--Install.log.syslog
|--Install.log
'--anaconda-ks.cfg

1 directory, 3 files
*****************************************************************************
-T is sorted with file and directory change times.
[Email protected] ~]# tree-t
.
|--Liyao
|--anaconda-ks.cfg
|--Install.log
'--Install.log.syslog

1 directory, 3 files
[email protected] ~]# ls-l
Total
-rw-------1 root root 1012 Jul 3 21:43 anaconda-ks.cfg
-rw-r--r--1 root root 27974 Jul 3 21:43 install.log
-rw-r--r--1 root root 4708 Jul 3 21:43 install.log.syslog
drwxr-xr-x 2 root root 4096 Jul 3 23:30 Liyao
*****************************************************************************
- l n displays only n-level directories (n is numeric)
[Email protected] ~]# tree-l 2
.
|--anaconda-ks.cfg
|--Install.log
|--Install.log.syslog
'--Liyao
'--Baobao

2 directories, 3 files
*****************************************************************************
The--dirsfirst directory appears after the previous file appears in the
[Email protected] ~]# tree--dirsfirst
.
|--Liyao
| '--Baobao
|--anaconda-ks.cfg
|--Install.log
'--Install.log.syslog

2 directories, 3 files

#####################################################################
(2) parameters that can be added, but not often used to get

-A uses Asni drawing characters to display a tree view instead of a combination of ASCII characters.
-C adds color to the list of files and directories, making it easy to differentiate between types.
-D lists the time that the file or directory was changed.
-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 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 displays only the file or directory name that conforms to the template style.
- Q with "?" control characters, listing file and directory names.
-S lists the file or directory size.
- 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.

CentOS Tree Command detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.