<span id="vexk9"><table id="vexk9"></table></span>

      tree

      樹(shù)狀圖列出目錄的內(nèi)容

      補(bǔ)充說(shuō)明

      tree命令 以樹(shù)狀圖列出目錄的內(nèi)容。

      語(yǔ)法

      tree(選項(xiàng))(參數(shù))
      

      選項(xiàng)

      ------- 列表選項(xiàng) -------
      -a            # 顯示所有文件和目錄。
      -d            # 顯示目錄名稱而非文件。
      -l            # 如遇到性質(zhì)為符號(hào)連接的目錄,直接列出該連接所指向的原始目錄。
      -f            # 在每個(gè)文件或目錄之前,顯示完整的相對(duì)路徑名稱。
      -x            # 將范圍局限在現(xiàn)行的文件系統(tǒng)中,若指定目錄下的某些子目錄,其存放于另一個(gè)文件系統(tǒng)上,則將該目錄予以排除在尋找范圍外。
      -L level      # 限制目錄顯示層級(jí)。
      -R            # Rerun tree when max dir level reached.
      -P pattern    # <范本樣式> 只顯示符合范本樣式的文件和目錄名稱。
      -I pattern    # Do not list files that match the given pattern.
      --ignore-case # Ignore case when pattern matching.
      --matchdirs   # Include directory names in -P pattern matching.
      --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.
      -------- 文件選項(xiàng) ---------
      -q            # 用“?”號(hào)取代控制字符,列出文件和目錄名稱。
      -N            # 直接列出文件和目錄名稱,包括控制字符。
      -Q            # Quote filenames with double quotes.
      -p            # 列出權(quán)限標(biāo)示。
      -u            # 列出文件或目錄的擁有者名稱,沒(méi)有對(duì)應(yīng)的名稱時(shí),則顯示用戶識(shí)別碼。
      -g            # 列出文件或目錄的所屬群組名稱,沒(méi)有對(duì)應(yīng)的名稱時(shí),則顯示群組識(shí)別碼。
      -s            # 列出文件和目錄大小。
      -h            # Print the size in a more human readable way.
      --si          # Like -h, but use in SI units (powers of 1000).
      -D            # 列出文件或目錄的更改時(shí)間。
      -F            # 在執(zhí)行文件,目錄,Socket,符號(hào)連接,管道名稱名稱,各自加上"*","/","@","|"號(hào)。
      --inodes      # Print inode number of each file.
      --device      # Print device ID number to which each file belongs.
      ------- 排序選項(xiàng) -------
      -v            # Sort files alphanumerically by version.
      -t            # 用文件和目錄的更改時(shí)間排序。
      -c            # Sort files by last status change time.
      -U            # Leave files unsorted.
      -r            # Reverse the order of the sort.
      --dirsfirst   # List directories before files (-U disables).
      --sort X      # Select sort: name,version,size,mtime,ctime.
      ------- 圖形選項(xiàng) ------
      -i            # 不以階梯狀列出文件和目錄名稱。
      -A            # 使用ASNI繪圖字符顯示樹(shù)狀圖而非以ASCII字符組合。
      -S            # Print with CP437 (console) graphics indentation lines.
      -n            # Turn colorization off always (-C overrides).
      -C            # 在文件和目錄清單加上色彩,便于區(qū)分各種類型。
      ------- XML / HTML / JSON選項(xiàng) -------
      -X            # Prints out an XML representation of the tree.
      -J            # Prints out an JSON 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.
      ---- 雜項(xiàng)選項(xiàng) ----
      --version     # 輸入版本信息。
      --help        # 打印使用幫助信息。
      --            # Options processing terminator.
      

      參數(shù)

      目錄:執(zhí)行tree指令,它會(huì)列出指定目錄下的所有文件,包括子目錄里的文件。

      實(shí)例

      列出目錄/private/ 第一級(jí)文件名

      tree  /private/ -L 1
      /private/
      ├── etc
      ├── tftpboot
      ├── tmp
      └── var
      

      忽略文件夾

      tree -I node_modules # 忽略當(dāng)前目錄文件夾node_modules
      tree -P node_modules # 列出當(dāng)前目錄文件夾node_modules的目錄結(jié)構(gòu)
      tree -P node_modules -L 2 # 顯示目錄node_modules兩層的目錄樹(shù)結(jié)構(gòu)
      tree -L 2 > /home/www/tree.txt # 當(dāng)前目錄結(jié)果存到 tree.txt 文件中
      

      忽略多個(gè)文件夾

      tree -I 'node_modules|icon|font' -L 2
      

      非樹(shù)狀結(jié)構(gòu)列出目錄/private/下的所有文件

      tree -if /private/
      /private
      /private/a1
      /private/a2
      /private/etc
      /private/etc/b1
      /private/etc/b2
      /private/tftpboot
      
      主站蜘蛛池模板: 久久综合五月丁香久久激情| 丁香色欲久久久久久综合网| 色综合久久综合中文综合网| 亚洲av综合色区| 亚洲欧洲日韩国产综合在线二区| 97se亚洲国产综合自在线| 色综合久久98天天综合| 亚洲综合国产精品| 一本色道久久88综合亚洲精品高清| 亚洲综合日韩久久成人AV| 亚洲综合成人婷婷五月网址| 综合久久久久久中文字幕亚洲国产国产综合一区首| 国产色综合一区二区三区| 99久久综合精品五月天| 色爱无码AV综合区| 久久久久亚洲AV综合波多野结衣| 一本色道久久88—综合亚洲精品| 久久一日本道色综合久久m| 色综合天天综合婷婷伊人| 六月婷婷缴清综合在线| 色噜噜狠狠色综合网| 91精品国产色综合久久不| 亚洲色偷偷偷鲁综合| 伊人色综合一区二区三区| 99久久国产综合精品女同图片| 小说区综合区首页| 色偷偷91综合久久噜噜噜男男| 色狠狠久久综合网| 综合欧美五月丁香五月| 一本久道综合色婷婷五月| 激情五月激情综合| 色偷偷91久久综合噜噜噜| 婷婷久久综合九色综合九七| 伊人久久大香线蕉综合网站| 天天综合色天天综合| 国产成人综合精品一区| 青青青伊人色综合久久| 亚洲精品综合久久中文字幕| 色综合天天综一个色天天综合网| 狠狠色伊人亚洲综合网站色| 激情婷婷成人亚洲综合|