Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the tree plug-in in centos

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you how to use the tree plug-in in centos, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Installation of tree:

Yum-y install tree

Or

Sudo apt-get install tree

Enter the name of the tree directory directly when using it to display the tree structure of the directory. The example is as follows:

Uninstall command for tree

Yum-y remove tree

Common usage:

Tree-a shows all

Tree-d displays only directories

Tree-L n n stands for numbers.. Indicates how many layers to display.

Tree-f shows the full path..

Of course, tree supports redirecting to a file.

Tree-L 4 > dirce.doc can generate documents in UTF8 format.. We can also check under windows..

Note: the generated TXT or other files are also garbled when opened under win. At this point, we have to choose the character encoding as UTF-8... Of course.. UTF-8 is the default character set under your linux.

Detailed explanation of tree command under inux-linux command to list the contents of the directory step by step in a tree view

Command format

Tree

(1) the longest parameter or option used by tree

-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 |

| | `-% gconf.xml |

| |-.gconfd |

| | `--saved_state |

| | .tcshrc |

|-- anaconda-ks.cfg

|-- install.log

`--install.log.syslog

*

-d displays the directory name instead of the content.

[root @ liyao~] # tree-d

.

`--liyao

1 directory

*

-f displays the full 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 add "*", "/", "=", "@", "|" in the execution file, directory, Socket, symbolic link, pipe name, respectively.

[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 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-tier directories (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 before the file is displayed after

[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 often used

-A displays the tree view using ASNI drawing characters instead of ASCII character combinations.

-C adds colors to file and directory lists to make it easy to distinguish between different types.

-D lists when the file or directory was changed.

-g lists the name of the group to which the file or directory belongs. If there is no corresponding name, the group identification number is displayed.

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

-I does not display file or directory names that match 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 file and directory list.

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

-p lists permission tags.

-P displays only file or directory names that match the template style.

-Q uses "?" Instead of the control character, the file and directory names are listed.

-s lists the file or directory size.

-u lists the owner name of the file or directory, and if there is no corresponding name, the user identification number is displayed.

-x limits the scope to the current file system, and if some subdirectory under the specified directory is stored on another file system, the subdirectory is excluded from the search.

On how to use the tree plug-in in centos to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report