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 end each output line with NUL, not 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
35 Written by David MacKenzie and Jim Meyering.
36
38 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
39 Report dirname translation bugs to <https://translationpro‐
40 ject.org/team/>
41
43 Copyright © 2018 Free Software Foundation, Inc. License GPLv3+: GNU
44 GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
45 This is free software: you are free to change and redistribute it.
46 There is NO WARRANTY, to the extent permitted by law.
47
49 basename(1), readlink(1)
50
51 Full documentation at: <https://www.gnu.org/software/coreutils/dirname>
52 or available locally via: info '(coreutils) dirname invocation'
53
54
55
56GNU coreutils 8.30 July 2018 DIRNAME(1)