In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the tree command in the Linux system, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
In the Linux system, the tree command is mainly used to list the contents of the directory in a tree view. When we execute the tree command, we list all the files in the specified directory.
Syntax tree [- aACdDfFgilnNpqstux] [- I] [- P] [directory.] Parameter description:-a displays all files and directories.
-A displays the tree view using ASNI drawing characters instead of ASCII character combinations.
-C adds colors to file and directory lists to make it easy to distinguish between different types.
-d displays the directory name instead of the content.
-D lists when the file or directory was changed.
-f displays the full relative path name before each file or directory.
-F add "*", "/", "=", "@", "|" in the execution file, directory, Socket, symbolic link, pipe name, respectively.
-g lists the name of the group to which the file or directory belongs. If there is no corresponding name, the group identification number is displayed.
-I do not list file or directory names in a ladder.
-L level restricts the directory display level.
-l if you encounter a directory with a symbolic connection, directly list the original directory that the connection points to.
-n does not add color to the file and directory list.
-N lists file and directory names directly, including control characters.
-p lists permission tags.
-P displays only file or directory names that match the template style.
-Q uses "?" Instead of the control character, the file and directory names are listed.
-s lists the file or directory size.
-t sort by the change time of files and directories.
-u lists the owner name of the file or directory, and if there is no corresponding name, the user identification number is displayed.
-x limits the scope to the current file system, and if some subdirectory under the specified directory is stored on another file system, the subdirectory is excluded from the search.
Case demonstration: 1. Tree-everything in the current directory is displayed
Lwnyls@lwnyls-desktop:/usr$ tree2.tree-L level- only displays the directory structure of the specified maximum depth under the current directory
Lwnyls@lwnyls-desktop:/usr$ tree-L 1. ├── bin ├── games ├── include ├── lib ├── lib32 local sbin ├── share └── src 9 directories, 0 files lwnyls@lwnyls-desktop:/usr$3.-d displays the directory name instead of the content.
Lwnyls@lwnyls-desktop:~/VirtualBox VMs$ tree-d. ├── win7 │ └── Logs ├── winxp │ ├── Logs │ └── Snapshots └── xp2 └── Logs 7 directories lwnyls@lwnyls-desktop:~/VirtualBox VMs$4.-f displays the full relative path name before each file or directory. 5.Must sorts by the change time of files and directories.
Lwnyls@lwnyls-desktop:~/VirtualBox VMs$ tree-f. ├──. / win7 │ ├──. / win7/Logs │ │ ├──. / win7/Logs/VBox.log │ │ ├──. / win7/Logs/VBox.log.1 │ │ ├──. / win7/Logs/VBox.log.2 │ │ └──. / win7/Logs/VBox.log.3 │ ├──. / win7/win7.vbox │ └─ ─. / win7/win7.vbox-prev ├──. / winxp │ ├──. / winxp/Logs │ │ ├──. / winxp/Logs/VBox.log │ │ ├──. / winxp/Logs/VBox.log.1 │ │ ├──. / winxp/Logs/VBox.log.2 │ │ └──. / winxp/Logs/VBox.log.3 │ ├──. / winxp/Snapshots │ ├──. / winxp/winxp.vbox │ ├──. / winxp/winxp.vbox-prev │ └──. / winxp/winxp.vdi └──. / xp2 ├──. / xp2/Logs │ ├──. / xp2/Logs/VBox.log │ ├──. / xp2/Logs/VBox.log.1 │ ├──. / xp2/Logs/VBox .log.2 │ └──. / xp2/Logs/VBox.log.3 ├──. / xp2/xp2.vbox ├──. / xp2/xp2.vbox-prev └──. / xp2/xp2.vdi 7 directories 20 files lwnyls@lwnyls-desktop:~/VirtualBox VMs$ lwnyls@lwnyls-desktop:~/VirtualBox VMs$ tree-t. ├── winxp │ ├── winxp.vdi │ ├── Logs │ │ ├── VBox.log │ │ ├── VBox.log.1 │ │ ├── VBox.log.2 │ │ └── VBox.log.3 │ ├── winxp.vbox winxp.vbox-prev Snapshots xp2 xp2.vbox Xp2.vbox-prev │ ├── xp2.vdi │ └── Logs │ ├── VBox.log │ ├── VBox.log.1 │ ├── VBox.log.2 │ └── VBox.log.3 └── win7 ├── win7.vbox ├── win7.vbox-prev └── Logs ├── VBox.log ├── VBox.log. 1 ├── VBox.log.2 └── VBox.log.3 7 directories More than 20 files lwnyls@lwnyls-desktop:~/VirtualBox VMs$ is all the content of the article "how to use tree commands in Linux system" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.