diff --git a/pages/common/tree.md b/pages/common/tree.md deleted file mode 100644 index 515b260328..0000000000 --- a/pages/common/tree.md +++ /dev/null @@ -1,27 +0,0 @@ -# tree - -> Show the contents of the current directory as a tree. - -- Show files and directories with a depth of 'num' (where 1 means the current directory): - -`tree -L {{num}}` - -- Show directories only: - -`tree -d` - -- Show hidden files too: - -`tree -a` - -- Print human readable size of files: - -`tree -h` - -- Print the full path for each file: - -`tree -f` - -- Print the tree without lines and indentation. Useful when used with -f: - -`tree -i` diff --git a/pages/linux/tree.md b/pages/linux/tree.md new file mode 100644 index 0000000000..727d490d5e --- /dev/null +++ b/pages/linux/tree.md @@ -0,0 +1,27 @@ +# tree + +> Show the contents of the current directory as a tree. + +- Show files and directories up to 'num' levels of depth (where 1 means the current directory): + +`tree -L {{num}}` + +- Show directories only: + +`tree -d` + +- Show hidden files too: + +`tree -a` + +- Print the tree without indentation lines, showing the full path instead: + +`tree -i -f` + +- Print the size of each node next to it, in human-readable format: + +`tree -s -h` + +- Filter the tree using a wildcard (glob) pattern: + +`tree -P {{*.txt}}` diff --git a/pages/osx/tree.md b/pages/osx/tree.md new file mode 100644 index 0000000000..ab84aee677 --- /dev/null +++ b/pages/osx/tree.md @@ -0,0 +1,31 @@ +# tree + +> Show the contents of the current directory as a tree. + +- Show files and directories up to 'num' levels of depth (where 1 means the current directory): + +`tree -L {{num}}` + +- Show directories only: + +`tree -d` + +- Show hidden files too: + +`tree -a` + +- Print the tree without indentation lines, showing the full path instead: + +`tree -i -f` + +- Print the size of each node next to it, in human-readable format, with folders displaying their cumulative size (as in the `du` command): + +`tree -s -h --du` + +- Find files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files: + +`tree -P {{*.txt}} --prune` + +- Find directories within the tree hierarchy, pruning out directories that aren't ancestors of the wanted one: + +`tree -P {{directory_name}} --matchdirs --prune`