From cc3c94950906c05d7ff1cf4881307f0c7aa13e45 Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Thu, 17 Sep 2020 08:49:09 -0300 Subject: [PATCH] tree: add -C, --du and --prune examples (#4332) --- pages/linux/tree.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pages/linux/tree.md b/pages/linux/tree.md index f1e4f9261..8a13dc90e 100644 --- a/pages/linux/tree.md +++ b/pages/linux/tree.md @@ -1,6 +1,7 @@ # tree > Show the contents of the current directory as a tree. +> More information: . - Print files and directories up to 'num' levels of depth (where 1 means the current directory): @@ -10,25 +11,25 @@ `tree -d` -- Print hidden files too: +- Print hidden files too with colorization on: -`tree -a` +`tree -a -C` - Print the tree without indentation lines, showing the full path instead (use `-N` to not escape whitespace and special characters): `tree -i -f` -- Print the size of each node next to it, in human-readable format: +- Print the size of each file and the cumulative size of each directory, in human-readable format: -`tree -s -h` +`tree -s -h --du` -- Filter the tree using a wildcard (glob) pattern: +- Print files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files: -`tree -P {{*.txt}}` +`tree -P '{{*.txt}}' --prune` -- Ignore entries that match a wildcard (glob) pattern: +- Print directories within the tree hierarchy, using the wildcard (glob) pattern, and pruning out directories that aren't ancestors of the wanted one: -`tree -I {{*.txt}}` +`tree -P {{directory_name}} --matchdirs --prune` - Print the tree ignoring the given directories: