Tree diagram shows the terminal directory contents -tree

To list the contents of a directory tree view, at a glance

Execution treeof instructions, it will list all the files in the specified directory, including subdirectories in the file.

installation

We can easily install it through the package management tool

  • mac - brew install tree
  • debian series - apt install tree
  • CentOS - yum - -y install tree

use

Syntax :tree [- aACdDfFgilnNpqstux][- I <范本样式>][- P <范本样式>][目录...]

Common Commands

  • -a displays all files and directories.

  • -C file and directory listing plus color, easy to distinguish types.

  • -D list to change the time the file or directory.

  • -f before each file or directory, display the full relative path name.

  • -s lists the file or directory size.

  • -t Sort by modification time of files and directories.

    If the input command tree -aCDFt

Other commands

  • -A character display graphics using ASNI tree rather than the ASCII character combination.
  • -d directory names rather than content.
  • -F executing files, directories, Socket, symbolic links, piping name names, each coupled with "*", "/", "=", "@", "|" number.
  • -g lists the group name belongs to a file or directory, when no corresponding name, group identification code is displayed.
  • -i do not stepwise listed file or directory name.
  • -I do not display the file or directory name matches the template style.
  • The properties -l encountered directory is a symbolic link, the original directory listed directly to the connection points.
  • -N listed directly file and directory names, including control characters.
  • -p lists the permissions marked.
  • -P show only the file or directory name matches the template style.
  • -q use "?" was replaced by control characters listed in the file and directory names.
  • -u listed owner name of the file or directory, when no corresponding name, user identification code is displayed.
  • -x limited the scope of the existing file system, if certain subdirectories under the specified directory, which is stored in another file system, then the subdirectories to be excluded from the scope of looking outside.

More tips please tree -helpget

Using alias

By alias alias can be customized instructions, such as the author is provided

alias tree='tree -aC'
alias tree2='tree -L 2'
alias tree3='tree -L 3'

In this way, tree2you can achieve tree -aCL 2the same input

More

More excellent tool, please focus on micro-channel public number acquisition

This article from the blog article multiple platforms OpenWrite release!

Guess you like

Origin www.cnblogs.com/cchao1024/p/11685933.html