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

tree 数状型结构显示目录下的内容的更多相关文章

  1. tree:以树形结构显示目录下的内容

    tree命令 1.命令详解 [功能说明] tree命令的中文意思为“树”,功能是以树形结构列出指定目录下的所有内容包括所有文件.子目录及子目录里的目录和文件. [语法格式] tree [option] ...

  2. ls 显示目录下的内容和文件相关属性信息

    1.命令功能 ls命令是“list directory contents”,显示当前目录下的内容和文件属性. 2.语法格式 ls  [option]  file ls  选项  文件名 3.选项说明 ...

  3. 显示目录下的内容--ls

    ls               显示当前目录下的所有文件或者文件夹,但不包括 . 和 .. ls -a                  显示当前目录下的所有文件或者文件夹 ls -l        ...

  4. php删除目录及目录下的内容

    今天遇到一个问题: java写的API,ppt转图片生成的目录和文件 在使用php调用API完成后,再使用php进行删除时,遇到了删除失败的问题 部署的环境是Ubuntu 导致删除失败的原因是权限的问 ...

  5. linux下怎么用tree命令以树形结构显示文件目录结构?

    tree命令以树状图列出文件目录结构.不过某些Linux上(Centos 6.4)没有tree命令,本文将介绍安装方法. 常用参数: ? 1 2 3 4 5 6 tree -d 只显示目录.   tr ...

  6. 【转】linux tree命令以树形结构显示文件目录结构 ---- 不错

    原文网址:http://jingyan.baidu.com/article/acf728fd19c7eff8e510a3eb.html 今天小编来给分享Linux 系统下一个非常有用的命令的使用:tr ...

  7. java 显示目录下全部文件

    package gao.org; import java.awt.HeadlessException; import java.io.File; import javax.swing.JFileCho ...

  8. php 数组变成树状型结构

    <? php $stime = microtime(true); $nodes = [ ['id' = > 1, 'pid' = > 0, 'name' = > 'a'], [ ...

  9. linux du 显示目录下的各个子目录的大小

    use  command du  display estimate file space usage size of subdirectories [oracle@ahjcyl-db backup]$ ...

随机推荐

  1. SpringCloud 教程 (一) 消息总线(Spring Cloud Bus)

    Spring Cloud Bus 将分布式的节点用轻量的消息代理连接起来.它可以用于广播配置文件的更改或者服务之间的通讯,也可以用于监控.本文要讲述的是用Spring Cloud Bus实现通知微服务 ...

  2. Java称霸编程语言排行榜

    笔者精挑细选了本周研发频道的热门看点,供您在这个周末阅读欣赏.内容涵盖TIOBE编程语言8月份排行榜.开源挑战.WebGL演示.HTML5在线工具.IT职业身涯的14个建议,还有即将举行的SDCC(中 ...

  3. bootstrap中selectpicker下拉框使用方法实例

    最近一直在用bootstrap 的一些东西,写几篇博客记录下.... bootstrap selectpicker是bootstrap里比较简单的一个下拉框的组件,先看效果如下: 附上官网api链接, ...

  4. Java中使用Redis的几种数据类型总结

    1.String,最基本的类型 方法  set.get 2.hash redis 127.0.0.1:6379> HMSET user:1 username redis.net.cn passw ...

  5. vue路由实例

    router.js: import Vue from 'vue' import Router from 'vue-router' import Home from '@/components/Home ...

  6. Windows XP SP2上安装.net 4

    1.安装 KB893803-v2-x86 2.安装dotnetfx35 3.安装dotNetFx40_Client_x86_x64 4.安装 NET Framework 4.0

  7. buildroot

    http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2 简介 buildroot是一个Makefiles和 ...

  8. 解决旋转屏幕闪退在androidManifest.template.xml里,activity项添加:

     解决旋转屏幕闪退在androidManifest.template.xml里,activity项添加:android:configChanges="orientation|keyboard ...

  9. mysql数据库连接 application.properties

    # 数据库链接信息mysql.driver=com.mysql.cj.jdbc.Drivermysql.url=jdbc:mysql://localhost:3306/xxxx?characterEn ...

  10. vue复合组件----注册表单

    <!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...