tree: 查看目录结构

tree常见命令参数

usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-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.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-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.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.

常用的命令展示

查看某一个目录的文件结构

[root@localhost ~]# tree /home/omc/ftl

只显示一层目录

[root@localhost ~]# tree -L 1  -d /home/omc/ftl
[root@localhost ~]# tree -Ld 1 /home/omc/ftl 【效果同上】

利用find只查找一层目录

[root@localhost ~]# findfind /home/omc/ftl -maxdepth 1 -type d       最大深度为1

Linux tree命令详解的更多相关文章

  1. linux shell 脚本攻略学习16--wc命令详解,tree命令详解

    在文本处理的工作中,统计文件的行数,单词数和字符数非常有用.而对于开发人员本身来说,统计LOC(line of code ,代码行数)是一件重要的工作.linux中有什么命令可以帮助我们做统计呢?没错 ...

  2. CentOS tree命令详解

    inux下tree命令详解---linux以树状图逐级列出目录的内容命令 ############################################################### ...

  3. linux awk命令详解

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  4. linux cat 命令详解

    linux cat 命令详解 http://linux.chinaunix.net/techdoc/system/2007/11/16/972467.shtml adb shell su //这个不一 ...

  5. 【初级】linux rm 命令详解及使用方法实战

    rm:删除命令 前言: windows中的删除命令大家都不陌生,linux中的删除命令和windows中有一个共同特点,那就是危险,前两篇linux mkdir 命令详解及使用方法实战[初级]中我们就 ...

  6. Linux netstat命令详解

    Linux netstat命令详解 一  简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多 ...

  7. linux grep命令详解

    linux grep命令详解 简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来 ...

  8. Linux chmod命令详解

    Linux chmod命令详解 chmod----改变一个或多个文件的存取模式(mode)   chmod [options] mode files   只能文件属主或特权用户才能使用该功能来改变文件 ...

  9. 【转发】linux yum命令详解

    linux yum命令详解 yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理, ...

随机推荐

  1. 6-nginx-会话一致性解决(sesion一致)

    由于tomcat使用的为集群, 通过nginx访问时轮询不同的tomcat, 使得session无法统一, 所以将session单独抽取出来做共享session. 此tomcat版本为 7.0.61. ...

  2. linux之tmpfs

    1.概述 tmpfs是ramfs的衍生品,ramfs是基于RAM的文件系统,不能使用swap空间:tmpfs可以动态释放空间.可以使用swap空间.ramfs不能控制使用内存的大小容易使内存爆掉:而t ...

  3. Dev中控件的js事件代码放在form标签中存在问题

    Dev中控件的js事件代码放在form标签中会获取不到(head标签中有其他js代码,未验证是否是这个问题)

  4. struts2入门实例

    引言: 接触.net有3.4年的时间了,一直想学习java,中间因为种种原因耽搁下来.本人学习java的目的,一是多条出路,二是和.net平台互相印证,毕竟只用一门语言,无论是在框架还是在眼界方面都会 ...

  5. java SE 入门之语言与环境(第一篇)

    Javase的语言与开发环境Keke2016年03月08日 Java属于-Oracle公司(甲骨文)创始人:Gosling1995年诞生1998年12月发布jdk1.22002年2月发布:jdk1.4 ...

  6. Java的简单书写格式

    在一个java源代码中只能出现一个public类,而且必须跟文件名相同 在源代码的全局域类中只有 public 和 default 两种可见度 全局域不能写代码,只能定义类 成员类的构造方法和类的可见 ...

  7. 三角形-->九九乘法表

    使用嵌套循环打印九行*组成的三角形: * ** *** ...... *********(9个) public class Triangle { /** * 使用嵌套循环打印九行*组成的三角形 */ ...

  8. 高并发第六弹:线程封闭(ThreadLocal)

    当访问共享的可变数据时,通常需要使用同步.一种避免使用同步的方式就是不共享数据.如果仅在单线程内访问数据,就不需要同步.这种技术被称为线程封闭. 它其实就是把对象封装到一个线程里,只有一个线程能看到这 ...

  9. 对MVC模式与MVVM模式的认识

    MVC模式与MVVM模式目的一样,主要是分离模型(model)和视图(view),具体介绍如下. 名词介绍 MVC模式:指的是模型(Model)-- 视图(View)-- 控制器(Controller ...

  10. PHP IN_ARRAY 函数 使用需要注意的地方

    今天 看PPChttp://bbs.phpchina.com/thread-171993-1-7.html 这个问题. 其实关键还是因为 php是弱类型语言,php进行比较的时候 最好还是使用stri ...