linux -- 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.  
    #显示N层目录
 
-R            Rerun tree when max dir level
reached.
  -P pattern    List only those files
that match the pattern
given.  #只显示符合"pattern"的文件或目录名称
 
-I pattern    Do not list files that match the given pattern.
   #不显示符合范本样式的文件或目录名称 tree
-I "*.c"

  --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.  
#使用ASNI绘图字符显示树状图而非以ASCII字符组合
  -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.

时间: 2024-08-29 05:12:28

linux -- tree 命令的相关文章

[转帖]linux tree命令--显示目录的树形结构

linux tree命令--显示目录的树形结构 版权声明:iamqilei@qq.com https://blog.csdn.net/u011729865/article/details/53368446 今天早上自己更新同事的 增量补丁 发现文件格式目录不对 就tree 了一下 具体方法 先安装epel-release 包 然后安装 tree包 然后使用 tree -FC -L 5 进行显示 邮件反馈 直接抄一下别人的blog 就不自己写了 以后 这种命令 要活学活用了. tree -C tr

Linux tree 命令乱码

今天在执行Linux下的tree命令的时候,出现了乱码.上网查了一下说需要使用tree --charset ASCII,强制使用ASCII字符.这样确实可以输出正常了.但是我的环境里的LANG=US.UTF-8,这样如果有非ASCII字符的时候,那么一 样会造成输出乱码. 既然tree让可以设置charset,那么根据我的环境下的字符集,我就执行tree --charset UTF-8,发现还是乱码.这就想不通了.突然意识到是不是自己的SecureCRT里面的设置不对啊. 检查SecureCRT

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

原文网址:http://jingyan.baidu.com/article/acf728fd19c7eff8e510a3eb.html 今天小编来给分享Linux 系统下一个非常有用的命令的使用:tree命令可以以树形结构显示文件目录结构,它非常适合于我们给别人介绍我们的文件目录的组成框架,同时该命令使用适当的参数也可以将命令结果输出到文本文件中. 本经验说明: 小编的这个建议只适合于10.10之前版本的ubuntu系统,后面的11.04,11.10...14.04系统因为采用的默认桌面不同,所

linux tree命令

1.tree命令功能与安装 tree命令以树状图列出文件目录结构,在线安装命令 yum install tree 回车 [[email protected] ~]# yum install tree Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile  * base: mirror.bit.edu.cn  * extras: mirror.bit.edu.cn  * updates:

deepin linux tree命令安装

首次使用tree [email protected]:/usr/bin$ tree bash: tree: 未找到命令 更新软件包 sudo apt-get update 安装tree命令 sudo apt-get install tree 安装完成后如下图所示 原文地址:https://www.cnblogs.com/longlogs/p/11886558.html

linux tree命令以树形结构显示文件目录结构

http://jingyan.baidu.com/article/acf728fd19c7eff8e510a3eb.html winscp  传递文件到ubuntu上用winscp

linux基础命令——tree

Linux基础命令--tree 编辑文章 -d :只显示目录,不显示其目录下的子文件 -L level:显示第几级 图片描述 显示以rc开头的 备份: 创建多级目录: -v:可以看过程

linux命令(5)---tree命令

tree命令:tree - list contents of directories in a tree-like format [功能] tree命令用于显示目录层级结构关系,常用就是单独tree命令,选项很多可根据日后工作中使用到的在进行查询man帮助 这个命令一般linux系统不自带需要手动安装,安装方法:可挂载光盘切换至光盘目录下,查找安装包名再使用rpm -ivh 安装 语法: tree [option] DIR 安装实例 [[email protected] ~]# mkdir /m

linux下tree命令详解

1.description方法是NSObject自带的方法,包括类方法和对象方法 + (NSString *)description; // 默认返回 类名 - (NSString *)description; // 默认返回 <类名:内存地址> 2.默认情况下利用NSLog和%@输出对象的时返回的就是类名和内存地址 3.修改NSLog和%@的默认输出:重写类对象或者实例对象的description方法即可.因为NSLog函数进行打印的时候会自动调用description方法 /*******