tree
Displays the directory structure of a path or of the disk in a drive graphically. Windows commands reference
On Windows 2 Sigma rules name it
Windows
Displays the directory structure of a path or of the disk in a drive graphically. The structure displayed by this command depends upon the parameters that you specify at the command prompt. If you don't specify a drive or path, this command displays the tree structure beginning with the current directory of the current drive.
tree [<drive>:][<path>] [/f] [/a]
To display the names of all the subdirectories on the disk in your current drive, type
tree \IdentifyTo display, one screen at a time, the files in all the directories on drive C, type
tree c:\ /f | moreIdentify/fDisplays the names of the files in each directory. Windows commands referenceTo print a list of all the directories on drive C to a file, type
tree c:\ /f > <driveletter>:<filepath>\filename.txtIdentify/fDisplays the names of the files in each directory. Windows commands reference<drive>:Specifies the drive that contains the disk for which you want to display the directory structure.<path>Specifies the directory for which you want to display the directory structure./fDisplays the names of the files in each directory./aSpecifies to use text characters instead of graphic characters to show the lines that link subdirectories./?Displays help at the command prompt.Several platforms
Show the contents of the current directory as a tree.
Print files and directories up to num levels of depth (where 1 means the current directory)
tree -L numIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print directories only
tree -dIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print hidden files too with colorization on
tree -a -CIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print the tree without indentation lines, showing the full path instead (use -N to not escape non-printable characters)
tree -i -fIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print the size of each file and the cumulative size of each directory, in human-readable format
tree -s -h --duIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files
tree -P '*.txt' --pruneIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print directories within the tree hierarchy, using the wildcard (glob) pattern, and pruning out directories that aren't ancestors of the wanted one
tree -P directory_name --matchdirs --pruneIdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Print the tree ignoring the given directories
tree -I 'directory_name1'IdentifyTrips 1 Sigma rule: informationalFile and Directory Discovery - Linux by Daniil Yugoslavskiy, oscd.community, CheraghiMilad
Windows
Display a graphical tree of the directory structure for a path.
Display the tree for the current directory
treeIdentifyDisplay the tree for a specific directory
tree path\to\directoryIdentifyDisplay the tree for a directory including files
tree path\to\directory /fIdentify/fDisplays the names of the files in each directory. Windows commands referenceDisplay the tree using aSCII characters instead of extended characters
tree path\to\directory /aIdentify/aSpecifies to use text characters instead of graphic characters to show the lines that link subdirectories. Windows commands reference