Linux tree 命令用法

2021-06-28 20:19:41 字數 3135 閱讀 5578

-a 顯示所有檔案和目錄。

-a 使用asni繪圖字元顯示樹狀圖而非以ascii字元組合。

-c 在檔案和目錄清單加上色彩,便於區分各種型別。

-d 顯示目錄名稱而非內容。

-d 列出檔案或目錄的更改時間。

-f 在每個檔案或目錄之前,顯示完整的相對路徑名稱。

-f 在執行檔案,目錄,socket,符號連線,管道名稱名稱,各自加上"*","/","=","@","|"號。

-g 列出檔案或目錄的所屬群組名稱,沒有對應的名稱時,則顯示群組識別碼。

-i 不以階梯狀列出檔案或目錄名稱。

-i 不顯示符合範本樣式的檔案或目錄名稱。

-l 如遇到性質為符號連線的目錄,直接列出該連線所指向的原始目錄。

-n 不在檔案和目錄清單加上色彩。

-n 直接列出檔案和目錄名稱,包括控制字元。

-p 列出許可權標示。

-p 只顯示符合範本樣式的檔案或目錄名稱。

-q 用"?"號取代控制字元,列出檔案和目錄名稱。

-s 列出檔案或目錄大小。

-t 用檔案和目錄的更改時間排序。

-u 列出檔案或目錄的擁有者名稱,沒有對應的名稱時,則顯示使用者識別碼。

-x 將範圍侷限在現行的檔案系統中,若指定目錄下的某些子目錄,其存放於另乙個檔案系統上,則將該子目錄予以排除在尋找範圍外。

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 #]

-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.

-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.

實現Linux tree命令

linux下有這樣乙個命令,可以把當前目錄下的所有檔案和子檔案以tree的方式顯示出來,看下效果 crazybaby localhost test tree a b c test2 d e f 3 directories,4 files crazybaby localhost test 自己用遞迴方...

Linux Tree命令詳解

中文翻譯 a 顯示所有檔案和目錄。a 使用asni繪圖字元顯示樹狀圖而非以ascii字元組合。c 在檔案和目錄清單加上色彩,便於區分各種型別。d 顯示目錄名稱而非內容。d 列出檔案或目錄的更改時間。f 在每個檔案或目錄之前,顯示完整的相對路徑名稱。f 在執行檔案,目錄,socket,符號連線,管道名...

Linux tree命令詳解

語法 tree 選項 引數 選項 a 顯示所有檔案和目錄 a 使用asni繪圖字元顯示樹狀圖而非以ascii字元組合 c 在檔案和目錄清單加上色彩,便於區分各種型別 d 先是目錄名稱而非內容 d 列出檔案或目錄的更改時間 f 在每個檔案或目錄之前,顯示完整的相對路徑名稱 f 在執行檔案,目錄,soc...