标签: tree

  • Ubuntu之tree命令

    一般而言,ls 只是一个简单的 list 工具(虽然可以用各种参数组合来达到一些复杂的功能),但如果想要查看一个目录的目录结构就力不从心了,需要一种打印目录树的 tree 工具。

    一段简短而强大的代码

    很早以前,在网上看到一段简短而强大的代码,最终可以达到下面这种效果:

    ~tree .local
    
    /home/dem/.local
       |-share
       |---applications
       |---desktop-directories
    
    ~ cd apps/firefox
    ~$ tree
    
    /home/dem/apps/firefox
       |-chrome
       |---icons
       |-----default
       |-components
       |-defaults
       |---autoconfig
       |---pref
       |---profile
       |-----chrome
       |-extensions
       |---{972ce4c6-7e08-474-a285-320298ce6fd}   
       |---inspector~mozilla.org
       |-----chrome
       |-----components
       |-----defaults
       |-------preferences
       |---talkback~mozilla.org
       |-----components
       |-------talkback
       |-greprefs
       |-icons
       |-plugins
       |-res
       |---dtd
       |---entityTables
       |---fonts
       |---html
       |-searchplugins
       |-updates
       |---0
    

    (更多…)