In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the tree command in Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
The Linux common command tree command lists the contents of the directory in a tree view.
The tree tree view lists the contents of the directory
Syntax tree (options) (parameters) option-list option-a # displays all files and directories. -d # displays the directory name instead of the file. -l # if you encounter a directory with a symbolic connection, directly list the original directory that the connection points to. -f # displays the full relative path name before each file or directory. -x # limits the scope to the current file system, and excludes some subdirectories under the specified directory from the search if they are stored on another file system. -L level # restricts the directory display level. -R # Rerun tree when max dir level reached. -P pattern # displays only file and directory names that match the template style. -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 # Print and format time according to the format. -o filename # Output to file instead of stdout. -File options-- Q # with "?" Instead of the control character, the file and directory names are listed. -N # lists file and directory names directly, including control characters. -Q # Quote filenames with double quotes. -p # lists permission tags. -u # lists the owner name of the file or directory, and if there is no corresponding name, the user identification number is displayed. -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. -s # lists file and directory sizes. -h # Print the size in a more human readable way. -- si # Like-h, but use in SI units (powers of 1000). -D # lists when the file or directory was changed. -F # adds "*", "/", "@", "|" to the execution file, directory, Socket, symbolic link, and pipe name respectively. -- inodes # Print inode number of each file. -- device # Print device ID number to which each file belongs. -sorting options-- v # Sort files alphanumerically by version. -t # sort by the change time of files and directories. -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. -graphic option-- I # does not list file and directory names in a ladder. -A # displays the tree view using ASNI drawing characters instead of ASCII character combinations. -S # Print with CP437 (console) graphics indentation lines. -n # Turn colorization off always (- C overrides). -C # colors the list of files and directories to make it easier to distinguish between types. -XML / HTML / JSON option-- 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. -Miscellaneous options-version # enter version information. -- help # print usage help. -# Options processing terminator. Parameter directory: execute the tree directive, which lists all files in the specified directory, including files in the subdirectory.
The instance lists the directory / private/ first-level file name
Tree / private/-L 1 / private/ ├── etc ├── tftpboot ├── tmp └── var ignore folders
Tree-I node_modules # ignore current directory folder node_modules tree-P node_modules # list current directory folder node_modules directory structure tree-P node_modules-L 2 # display directory node_modules two-tier directory tree structure tree-L 2 > / home/www/tree.txt # current directory results saved to tree.txt document ignore multiple folders
Tree-I 'node_modules | icon | font'-L 2 non-tree structure lists all files under the directory / private/
This is the end of tree-if / private/ / private/ private/a1 / private/a2 / private/etc/ private/etc/b1 / private/etc/b2 / private/tftpboot article on "how to use tree commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.