首页 > 代码库 > 显示目录树命令tree

显示目录树命令tree

-a:显示所有文件,包括隐藏文件

-d:只显示目录 

-f:显示完整的文件名,包含路径

-L:显示目录树的深度

[root@rusky /]# tree -L 2 -a -f /home
/home
|-- /home/99user.ldif
|-- /home/Legal
|   |-- /home/Legal/COPYRIGHT.txt
|   |-- /home/Legal/Entitlement_de.txt
|   |-- /home/Legal/Entitlement_es.txt
|   |-- /home/Legal/Entitlement_fr.txt
|   |-- /home/Legal/Entitlement_it.txt
|   |-- /home/Legal/Entitlement_ja.txt
|   |-- /home/Legal/Entitlement_ko.txt
|   |-- /home/Legal/Entitlement_sv.txt
|   |-- /home/Legal/Entitlement_zhCN.txt
|   |-- /home/Legal/Entitlement_zhTW.txt
|   |-- /home/Legal/Entitlements_1000Entries-Upgrade.txt
|   |-- /home/Legal/Entitlements_1000Entries.txt
|   |-- /home/Legal/Entitlements_250Entries-Upgrade.txt
|   |-- /home/Legal/Entitlements_250Entries.txt
|   |-- /home/Legal/LICENSE.txt
|   |-- /home/Legal/License_Notice_Translated.pdf
|   |-- /home/Legal/License_de.txt
|   |-- /home/Legal/License_es.txt
|   |-- /home/Legal/License_fr.txt
|   |-- /home/Legal/License_it.txt
|   |-- /home/Legal/License_ja.txt
|   |-- /home/Legal/License_ko.txt
|   |-- /home/Legal/License_sv.txt
|   |-- /home/Legal/License_zhCN.txt
|   |-- /home/Legal/License_zhTW.txt
|   |-- /home/Legal/Multilanguage_Entitlement.txt
|   `-- /home/Legal/THIRDPARTYLICENSEREADME.txt
|-- /home/apache-tomcat-6.0.37
|   |-- /home/apache-tomcat-6.0.37/LICENSE
|   |-- /home/apache-tomcat-6.0.37/NOTICE
|   |-- /home/apache-tomcat-6.0.37/RELEASE-NOTES
|   |-- /home/apache-tomcat-6.0.37/RUNNING.txt
|   |-- /home/apache-tomcat-6.0.37/bin
|   |-- /home/apache-tomcat-6.0.37/conf
|   |-- /home/apache-tomcat-6.0.37/lib
|   |-- /home/apache-tomcat-6.0.37/logs
|   |-- /home/apache-tomcat-6.0.37/temp
|   |-- /home/apache-tomcat-6.0.37/webapps
|   `-- /home/apache-tomcat-6.0.37/work
|-- /home/jdk-6u20-linux-i586.bin
|-- /home/jdk1.6.0_20
|   |-- /home/jdk1.6.0_20/COPYRIGHT
|   |-- /home/jdk1.6.0_20/LICENSE
|   |-- /home/jdk1.6.0_20/README.html
|   |-- /home/jdk1.6.0_20/README_ja.html
|   |-- /home/jdk1.6.0_20/README_zh_CN.html
|   |-- /home/jdk1.6.0_20/THIRDPARTYLICENSEREADME.txt
|   |-- /home/jdk1.6.0_20/bin
|   |-- /home/jdk1.6.0_20/db
|   |-- /home/jdk1.6.0_20/demo
|   |-- /home/jdk1.6.0_20/include
|   |-- /home/jdk1.6.0_20/jre
|   |-- /home/jdk1.6.0_20/lib
|   |-- /home/jdk1.6.0_20/man
|   |-- /home/jdk1.6.0_20/register.html
|   |-- /home/jdk1.6.0_20/register_ja.html
|   |-- /home/jdk1.6.0_20/register_zh_CN.html
|   |-- /home/jdk1.6.0_20/sample
|   `-- /home/jdk1.6.0_20/src.zip
|-- /home/king
|   |-- /home/king/META-INF
|   |-- /home/king/WEB-INF
|   |-- /home/king/com_sun_web_ui
|   |-- /home/king/css
|   |-- /home/king/html
|   |-- /home/king/images
|   |-- /home/king/js
|   |-- /home/king/jsp
|   `-- /home/king/testdir