From c5844c469b5ca73c5f85e8e7dc21aa63522cc95d Mon Sep 17 00:00:00 2001 From: Pavel Shtanko Date: Sun, 9 Feb 2020 00:08:19 +0100 Subject: [PATCH] tree: ignore specific directories (#3837) --- pages/linux/tree.md | 10 +++++++--- pages/osx/tree.md | 14 +++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pages/linux/tree.md b/pages/linux/tree.md index 836d19addd..f1e4f92612 100644 --- a/pages/linux/tree.md +++ b/pages/linux/tree.md @@ -2,15 +2,15 @@ > 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): +- Print files and directories up to 'num' levels of depth (where 1 means the current directory): `tree -L {{num}}` -- Show directories only: +- Print directories only: `tree -d` -- Show hidden files too: +- Print hidden files too: `tree -a` @@ -29,3 +29,7 @@ - Ignore entries that match a wildcard (glob) pattern: `tree -I {{*.txt}}` + +- Print the tree ignoring the given directories: + +`tree -I '{{directory_name1|directory_name2}}'` diff --git a/pages/osx/tree.md b/pages/osx/tree.md index e86ca33fc0..c086b50700 100644 --- a/pages/osx/tree.md +++ b/pages/osx/tree.md @@ -2,15 +2,15 @@ > 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): +- Print files and directories up to 'num' levels of depth (where 1 means the current directory): `tree -L {{num}}` -- Show directories only: +- Print directories only: `tree -d` -- Show hidden files too: +- Print hidden files too: `tree -a` @@ -22,10 +22,14 @@ `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: +- Print 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: +- 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 --prune` + +- Print the tree ignoring the given directories: + +`tree -I '{{directory_name1|directory_name2}}'`