tree命令的使用(过滤文件夹)
tree命令的參數(shù)
-a?顯示所有文件和目錄。
-A?使用ASNI繪圖字符顯示樹(shù)狀圖而非以ASCII字符組合。
-C?在文件和目錄清單加上色彩,便于區(qū)分各種類(lèi)型。
-d?顯示目錄名稱(chēng)而非內(nèi)容。
-D?列出文件或目錄的更改時(shí)間。
-f?在每個(gè)文件或目錄之前,顯示完整的相對(duì)路徑名稱(chēng)。
-F?在執(zhí)行文件,目錄,Socket,符號(hào)連接,管道名稱(chēng)名稱(chēng),各自加上"*","/","=","@","|"號(hào)。
-g?列出文件或目錄的所屬群組名稱(chēng),沒(méi)有對(duì)應(yīng)的名稱(chēng)時(shí),則顯示群組識(shí)別碼。
-i?不以階梯狀列出文件或目錄名稱(chēng)。
-I?不顯示符合范本樣式的文件或目錄名稱(chēng)。
-l?如遇到性質(zhì)為符號(hào)連接的目錄,直接列出該連接所指向的原始目錄。
-n?不在文件和目錄清單加上色彩。
-N?直接列出文件和目錄名稱(chēng),包括控制字符。
-p?列出權(quán)限標(biāo)示。
-P?只顯示符合范本樣式的文件或目錄名稱(chēng)。
-q?用"?"號(hào)取代控制字符,列出文件和目錄名稱(chēng)。
-s?列出文件或目錄大小。
-t?用文件和目錄的更改時(shí)間排序。
-u?列出文件或目錄的擁有者名稱(chēng),沒(méi)有對(duì)應(yīng)的名稱(chēng)時(shí),則顯示用戶(hù)識(shí)別碼。
-x?將范圍局限在現(xiàn)行的文件系統(tǒng)中,若指定目錄下的某些子目錄,其存放于另一個(gè)文件系統(tǒng)上,則將該子目錄予以排除在尋找范圍外。
上面列的不怎么全,完整的幫助信息是這樣的:
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?#]?[<directory?list>]
??-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.
??-F????????????Appends?'/',?'=',?'*',?or?'|'?as?per?ls?-F.
??-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.?
忽略某個(gè)文件夾的內(nèi)容
tree -I "node_modules"
tree -I "node_modules|cache|test_*"
只看兩級(jí)目錄
tree -L 2
?
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的tree命令的使用(过滤文件夹)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 以太网帧格式、最少字节介绍(arp)
- 下一篇: history 历史命令记录功能如何防坏