From 31a07858ca2d010625499fb9e942f9c1371b339a Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Wed, 24 Aug 2016 17:09:58 +0100 Subject: [PATCH] split tree.md into linux and osx versions, to cater to the different sets of available options --- pages/linux/tree.md | 27 +++++++++++++++++++++++++++ pages/{common => osx}/tree.md | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pages/linux/tree.md rename pages/{common => osx}/tree.md (64%) 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/common/tree.md b/pages/osx/tree.md similarity index 64% rename from pages/common/tree.md rename to pages/osx/tree.md index bca11fc9b9..ab84aee677 100644 --- a/pages/common/tree.md +++ b/pages/osx/tree.md @@ -22,6 +22,10 @@ `tree -s -h --du` -- Filter the tree using a wildcard (glob) pattern, showing only the hierarchies leading to the matching entries: +- 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`