1DIRNAME(1) User Commands DIRNAME(1)
2
3
4
6 dirname - strip last component from file name
7
9 dirname [OPTION] NAME...
10
12 Output each NAME with its last non-slash component and trailing slashes
13 removed; if NAME contains no /'s, output '.' (meaning the current
14 directory).
15
16 -z, --zero
17 separate output with NUL rather than newline
18
19 --help display this help and exit
20
21 --version
22 output version information and exit
23
25 dirname /usr/bin/
26 -> "/usr"
27
28 dirname dir1/str dir2/str
29 -> "dir1" followed by "dir2"
30
31 dirname stdio.h
32 -> "."
33
34 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
35 Report dirname translation bugs to <http://translationpro‐
36 ject.org/team/>
37
39 Written by David MacKenzie and Jim Meyering.
40
42 Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU
43 GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
44 This is free software: you are free to change and redistribute it.
45 There is NO WARRANTY, to the extent permitted by law.
46
48 basename(1), readlink(1)
49
50 The full documentation for dirname is maintained as a Texinfo manual.
51 If the info and dirname programs are properly installed at your site,
52 the command
53
54 info coreutils 'dirname invocation'
55
56 should give you access to the complete manual.
57
58
59
60GNU coreutils 8.22 October 2018 DIRNAME(1)