1.使用原生的ls方式: ➜ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' >tree.txt ➜ cat tree.txt |-SecureCRT.app |---Contents |-----Frameworks |-------QtCore.framework |---------Versions |-----------4 |-------------Resources |-------------_CodeSignature |-------QtGui.framework |---------Versions |-----------4 |-------------Resources |---------------qt_menu.nib |-------------_CodeSignature |-------QtNetwork.framework |---------Versions |-----------4 |-------------Resources |-------------_CodeSignature |-----MacOS |-----PlugIns |-------accessible |-------bearer |-------codecs |-------imageformats |-----Resources |-------English.lproj |---------SecureCRTHelp |-----------resource |-----------whdata |-----------whgdata |-----------whxdata |-------SecureCRT_UrlLauncher.app |---------Contents |-----------MacOS |-----------Resources |-------------Scripts |-----------_CodeSignature |-----_CodeSignature . . . . . . 2.使用tree命令 2.1 ➜ brew install tree // 安装 2.2 ➜ tree >tree.txt // 查看 ➜ tree --help usage: tree [-acdfghilnpqrstuvxACDFJQNSUX] [-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>] [--sort[=]<name>] [--matchdirs] [--ignore-case] [--] [<directory list>]
发表评论