>From 2c15992f5166ec983d5f800a08776aeb33a239d3 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Tue, 28 Jul 2020 21:32:45 +0200 Subject: [PATCH] doc: add examples for -maxdepth, -mindepth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/find.texi (-maxdepth): Add examples. (-mindepth): Reference them. Suggested by 積丹尼 Dan Jacobson in https://lists.gnu.org/r/bug-findutils/2020-07/msg00006.html --- doc/find.texi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/find.texi b/doc/find.texi index 1e4ab177..ce63ca52 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -1358,12 +1358,31 @@ slice of a directory tree. Descend at most @var{levels} (a non-negative integer) levels of directories below the command line arguments. @samp{-maxdepth 0} means only apply the tests and actions to the command line arguments. + +@example +$ mkdir -p dir/d1/d2/d3/d4/d5/d6 + +$ find dir -maxdepth 1 +dir +dir/d1 + +$ find dir -mindepth 5 +dir/d1/d2/d3/d4/d5 +dir/d1/d2/d3/d4/d5/d6 + +$ find dir -mindepth 2 -maxdepth 4 +dir/d1/d2 +dir/d1/d2/d3 +dir/d1/d2/d3/d4 +@end example @end deffn @deffn Option -mindepth levels Do not apply any tests or actions at levels less than @var{levels} (a non-negative integer). @samp{-mindepth 1} means process all files except the command line arguments. + +See @samp{-maxdepth} for examples. @end deffn @deffn Option -depth -- 2.28.0