summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi10
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index d1c308524..26b4eba64 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11991,14 +11991,17 @@ basename include/stdio.h .h
@cindex non-directory suffix, stripping
@command{dirname} prints all but the final slash-delimited component of
-a string (presumably a file name, but also works on directories). Synopsis:
+@var{name}. Slashes on either side of the final component are also
+removed. If the string contains no slash, @command{dirname} prints
+@samp{.} (meaning the current directory). Synopsis:
@example
dirname @var{name}
@end example
-If @var{name} is a single component, @command{dirname} prints @samp{.}
-(meaning the current directory).
+@var{name} need not be a file name, but if it is, this operation
+effectively lists the directory that contains the final component,
+including the case when the final component is itself a directory.
@basenameAndDirname
@@ -12017,6 +12020,7 @@ Examples:
@smallexample
# Output "/usr/bin".
dirname /usr/bin/sort
+dirname /usr/bin//.//
# Output ".".
dirname stdio.h