zoukankan      html  css  js  c++  java
  • tree 数状型结构显示目录下的内容

    1. 命令功能

      tree中文意思“树”,以树形结构显示目录内容。、

    2. 语法格式

      tree  [option]   [directory]

      tree  选项   目录

    3. 使用范例

    当最小化安装linux时,是没有安装tree命令的。

    范例1 : 不带参数执行tree,显示/bin下内容

    [root@localhost home]#

    [root@localhost home]# cd /bin

    [root@localhost bin]# tree

    .

    ├── arch

    ├── awk -> gawk

    ├── basename

    ├── bash

    ├── cat

    范例2:显示/home/cxf目录下全部目录树

    [cxf@localhost ~]$ tree -a

    .

    ├── abc

    ├── .bash_history

    ├── .bash_logout

    ├── .bash_profile

    ├── .bashrc

    ├── .lesshst

    ├── old

    │   ├── a

    │   ├── b

    范例3:只列出目录的目录树

    [cxf@localhost ~]$ tree -d

    .

    ├── old

    │   ├── a

    │   ├── b

    │   ├── c

    范例4:显示文件的全路径

    [cxf@localhost ~]$ tree -f

    .

    ├── ./abc

    └── ./test

        ├── ./test/dir1

        ├── ./test/dir2

        ├── ./test/dir3

        ├── ./test/dir4

        └── ./test/dir5

    6 directories, 1 file

    [cxf@localhost ~]$ tree -f /home/cxf

    /home/cxf

    ├── /home/cxf/abc

    └── /home/cxf/test

        ├── /home/cxf/test/dir1

        ├── /home/cxf/test/dir2

        ├── /home/cxf/test/dir3

        ├── /home/cxf/test/dir4

        └── /home/cxf/test/dir5

    6 directories, 1 file

    范例5:显示2层目录树

    [cxf@localhost ~]$ tree -L 2

    .

    ├── abc

    └── test

        ├── dir1

        ├── dir2

        ├── dir3

        ├── dir4

        └── dir5

    6 directories, 1 file

    [cxf@localhost ~]$ tree -L 2 --noreport

    .

    ├── abc

    └── test

        ├── dir1

        ├── dir2

        ├── dir3

        ├── dir4

    └── dir5

  • 相关阅读:
    React学习笔记(六)事件处理
    React学习笔记(五)State&声明周期
    学会装逼,你的人生可能会开挂
    Go指南
    JavaScript检测数据类型
    $.on()方法和addEventListener改变this指向
    JavaScript返回上一页
    js继承
    js原型二
    全局变量与局部变量
  • 原文地址:https://www.cnblogs.com/joechu/p/8611479.html
Copyright © 2011-2022 走看看