DIRNAME(1) General Commands Manual DIRNAME(1)

dirname - Strip last component from file name

dirname [-z|--zero] [-h|--help] [-V|--version] [dir]

Strip last component from file name

separate output with NUL rather than newline
Print help
Print version

Output each NAME with its last non-slash component and trailing slashes removed; if NAME contains no /'s, output '.' (meaning the current directory).

v(uutils coreutils) 0.9.0

2026-05-31