tree指令

安装tree库

sudo apt-get install tree

查看tree的帮助文档

:~$ tree --help
usage: tree [-acdfghilnpqrstuvxACDFQNSUX] [-H baseHREF] [-T title ] [-L level [-R]]
    [-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
    [--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
    [--filelimit[=]#] [--si] [--timefmt[=]<f>] [<directory list>]
  ------- Listing options -------
  -a            All files are listed.
  -d            List directories only.
  -l            Follow symbolic links like directories.
  -f            Print the full path prefix for each file.
  -x            Stay on current filesystem only.
  -L level      Descend only level directories deep.
  -R            Rerun tree when max dir level reached.
  -P pattern    List only those files that match the pattern given.
  -I pattern    Do not list files that match the given pattern.
  --noreport    Turn off file/directory count at end of tree listing.
  --charset X   Use charset X for terminal/HTML and indentation line output.
  --filelimit # Do not descend dirs with more than # files in them.
  --timefmt <f> Print and format time according to the format <f>.
  -o filename   Output to file instead of stdout.
  -------- File options ---------
  -q            Print non-printable characters as '?'.
  -N            Print non-printable characters as is.
  -Q            Quote filenames with double quotes.
  -p            Print the protections for each file.
  -u            Displays file owner or UID number.
  -g            Displays file group owner or GID number.
  -s            Print the size in bytes of each file.
  -h            Print the size in a more human readable way.
  --si          Like -h, but use in SI units (powers of 1000).
  -D            Print the date of last modification or (-c) status change.
  -F            Appends '/', '=', '*', '@', '|' or '>' as per ls -F.
  --inodes      Print inode number of each file.
  --device      Print device ID number to which each file belongs.
  ------- Sorting options -------
  -v            Sort files alphanumerically by version.
  -r            Sort files in reverse alphanumeric order.
  -t            Sort files by last modification time.
  -c            Sort files by last status change time.
  -U            Leave files unsorted.
  --dirsfirst   List directories before files (-U disables).
  ------- Graphics options ------
  -i            Don't print indentation lines.
  -A            Print ANSI lines graphic indentation lines.
  -S            Print with ASCII graphics indentation lines.
  -n            Turn colorization off always (-C overrides).
  -C            Turn colorization on always.
  ------- XML/HTML options -------
  -X            Prints out an XML representation of the tree.
  -H baseHREF   Prints out HTML format with baseHREF as top directory.
  -T string     Replace the default HTML title and H1 header with string.
  --nolinks     Turn off hyperlinks in HTML output.
  ---- Miscellaneous options ----
  --version     Print version and exit.
  --help        Print usage and this help message and exit.

操作举例

显示所有文件(不包括隐藏文件):

tree

  输出:

.
├── Image_Generated
│   ├── Averaging_Blur_Enhanced.jpg
│   ├── Averaging_Blur.jpg
│   ├── Completed_Blur.jpg
│   ├── Edge_Detection_360_degree.jpg
│   ├── Edge_Detection_45_degree.jpg
│   ├── Embossing_45_degree.jpg
│   ├── Embossing_Asymmetric.jpg
│   ├── Embossing_.jpg
│   ├── Gaussian_Blur.jpg
│   ├── Motion_Blur.jpg
│   ├── Naive.jpg
│   ├── Sharpness_Center.jpg
│   └── Sharpness_Edge.jpg
├── Image_Origin
│   └── Elegent_Girl.jpg
├── README.md
├── requirements.txt
└── src
    ├── convolution.py
    ├── filter.py
    ├── main.py
    └── run.sh

3 directories, 20 files

只显示文件夹:

tree -d

  输出:

.
├── Image_Generated
├── Image_Origin
└── src

3 directories

显示所有文件(包括隐藏文件):

tree -a

  输出:

.
├── .git
│   ├── branches
│   ├── COMMIT_EDITMSG
│   ├── config
│   ├── description
│   ├── FETCH_HEAD
│   ├── HEAD
│   ├── hooks
│   │   ├── applypatch-msg.sample
│   │   ├── commit-msg.sample
│   │   ├── post-update.sample
│   │   ├── pre-applypatch.sample
│   │   ├── pre-commit.sample
│   │   ├── prepare-commit-msg.sample
│   │   ├── pre-push.sample
│   │   ├── pre-rebase.sample
│   │   └── update.sample
│   ├── index
│   ├── info
│   │   └── exclude
│   ├── logs
│   │   ├── HEAD
│   │   └── refs
│   │       ├── heads
│   │       │   └── master
│   │       └── remotes
│   │           └── origin
│   │               └── master
│   ├── objects
│   │   ├── 0e
│   │   │   └── ec93e862fe54032b112ca19265fdb90609fb53
│   │   ├── 12
│   │   │   └── ffcdab3989314a79ad363e2a20671c29f3bd0c
│   │   ├── 16
│   │   │   └── 5e327e2f61cb84ace4bcd2c12a60874ec6fdc7
│   │   ├── 18
│   │   │   └── c7dcc2b44495e36d1fd9f3dfb39d96b8fcc0cf
│   │   ├── 1a
│   │   │   └── e55d35b920c90b26c27829dd55546c9a898c0a
│   │   ├── 22
│   │   │   ├── 4301ec4059d22e39736d710f5e38d0bb5e4e5e
│   │   │   └── 44f6edb803d0731d08b4ebeec5593ff5050118
│   │   ├── 23
│   │   │   └── 69dedcc32959f764e382d8b7ffe2035781f768
│   │   ├── 28
│   │   │   └── 82a713ba71f7843b5eea5aa0e7058f1afbdc23
│   │   ├── 3b
│   │   │   └── 00325224fe9769d0253eb6078d5e31c621892f
│   │   ├── 43
│   │   │   └── 642dee9c626b48d38470e1ed91fa4cf6a0361a
│   │   ├── 53
│   │   │   └── 8ec6dcb0e17c614948912061c40d7c2a2aaa73
│   │   ├── 54
│   │   │   └── b69844052ccad0a7f4829207f68020f8cbe2ff
│   │   ├── 59
│   │   │   └── 7ba6b940bbc208322052816cd209749e2967c1
│   │   ├── 5c
│   │   │   └── bb0212b2a864eff40369ade20792d13dee7aed
│   │   ├── 5f
│   │   │   └── deb71da3d17f8784a9b45eeee2c1fec99510fc
│   │   ├── 60
│   │   │   └── 85900d533af6a4d61419e71a887420c2583bd1
│   │   ├── 63
│   │   │   └── 1864dae56f33e711d1b742e4ef313d70e18371
│   │   ├── 65
│   │   │   └── 9fbad800e4d607444ded54c98638368957681e
│   │   ├── 69
│   │   │   └── da980783fa6db646bf0e3404c180b9309f7581
│   │   ├── 6d
│   │   │   └── 807e8acdcdc4e4b05596ec912691d7af9f79a4
│   │   ├── 76
│   │   │   └── a41df274117afc56715e46acf35daecb0b828b
│   │   ├── 87
│   │   │   └── 76aa55298eff4ca46c3ba2231d21e1b8cc5650
│   │   ├── 92
│   │   │   └── 83a3128ba8de5290052b2efd5b8504a4516384
│   │   ├── 93
│   │   │   └── 3a2011fd9e6f54cdd044ee74e9151758408ec9
│   │   ├── b9
│   │   │   └── 6444449dc64d52219a28aa1c9d06511349a522
│   │   ├── c7
│   │   │   └── 4772f9b1e58c8dd903dfa4a3c760bcd0fe901e
│   │   ├── cf
│   │   │   └── 7d3163f15935902f53d53a29a748660c4ed532
│   │   ├── d1
│   │   │   └── 411627491e803b66e57c1dbb2bc2228b2154ce
│   │   ├── e0
│   │   │   └── 228271b6d091a4d9a1b7dbfe4264124a531a6a
│   │   ├── ec
│   │   │   └── c399f41d63545e1a902d50cb211f91c3f045d0
│   │   ├── ee
│   │   │   ├── 077213f7bc3aa03d2025c7ecf372727530f590
│   │   │   └── 7db981a14bb8a09b87d542985a467fdda61153
│   │   ├── info
│   │   └── pack
│   ├── ORIG_HEAD
│   └── refs
│       ├── heads
│       │   └── master
│       ├── remotes
│       │   └── origin
│       │       └── master
│       └── tags
├── Image_Generated
│   ├── Averaging_Blur_Enhanced.jpg
│   ├── Averaging_Blur.jpg
│   ├── Completed_Blur.jpg
│   ├── Edge_Detection_360_degree.jpg
│   ├── Edge_Detection_45_degree.jpg
│   ├── Embossing_45_degree.jpg
│   ├── Embossing_Asymmetric.jpg
│   ├── Embossing_.jpg
│   ├── Gaussian_Blur.jpg
│   ├── Motion_Blur.jpg
│   ├── Naive.jpg
│   ├── Sharpness_Center.jpg
│   └── Sharpness_Edge.jpg
├── Image_Origin
│   └── Elegent_Girl.jpg
├── README.md
├── requirements.txt
└── src
    ├── convolution.py
    ├── filter.py
    ├── main.py
    └── run.sh

51 directories, 75 files


本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏SeanCheney的专栏

Scrapy-Redis分布式抓取麦田二手房租房信息与数据分析准备工作租房爬虫二手房分布式爬虫数据分析及可视化

试着通过抓取一家房产公司的全部信息,研究下北京的房价。文章最后用Pandas进行了分析,并给出了数据可视化。 ---- 准备工作 麦田房产二手房页面(http:...

8368
来自专栏菩提树下的杨过

Silverlight:利用异步加载Xap实现自定义loading效果

关键点: 1.利用WebClient的DownloadProgressChanged事件更新下载进度 2.下载完成后,分析Xap包的程序集Assembly信息 ...

21310
来自专栏菩提树下的杨过

ExtJs学习笔记(4)_EditorGridPanel(可编辑的网格控件)

这一节,我们将看到ExtJs功能强大的可编辑网格控件,几乎与VS.Net的GridView功能一样了,但是ExtJs的可是纯JS的UI 一.静态示例(改自Ext...

7125
来自专栏生信技能树

linux 命令中英文对照,收集

听说markdown排版得用浏览器打开,点击最下面的阅读原文也可以! Is Linux CLI case-sensitive? The answer is, y...

3916
来自专栏Y大宽

RNA-seq数据分析工具详细介绍(从质量控制到可视化)

2813
来自专栏岑志军的专栏

ReactNative-ListView

1983
来自专栏WOLFRAM

by 骁君

1383
来自专栏张善友的专栏

SharpForge - Open source SourceForge / CodePlex implementation

SharpForge - Open source SourceForge / CodePlex implementation SharpForge suppo...

20710
来自专栏逸鹏说道

逆天通用水印扩展篇~新增剪贴板系列的功能和手动配置,卸除原基础不常用的功能

常用技能:http://www.cnblogs.com/dunitian/p/4822808.html#skill 逆天博客:http://dnt.dkil.n...

28510
来自专栏闵开慧

eclipse中运行hbase时显示Connection refused: no furthe...

java.net.ConnectException: Connection refused: no further information at ...

7617

扫码关注云+社区

领取腾讯云代金券