Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to generate a directory tree using the tree command

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use the tree command to generate a directory tree, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Generate structure tree in cmd

Open the cmd command line tool in the current directory

Enter the tree command-enter

Then you will find that the structure tree you need has already appeared, but if you look carefully, you will find that only folders are displayed.

If you want to display the current file name, you just need to change the command to tree / f, enter and find that it is perfect.

At this time, if you want to turn this structure into a txt text file, just change the above command to tree > name .txt, and then no special information will be displayed on the command line, but you will find that the file you generated has already appeared.

Options for the tree command

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

-I does not display file or directory names that match the template style.

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

After reading the above, have you mastered how to use the tree command to generate a directory tree? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report