DIRNAME(1) General Commands Manual DIRNAME(1)

# [NAME](#NAME)

dirname - Strip last component from file name

# [SYNOPSIS](#SYNOPSIS)

**dirname** \[OPTION] NAME...

# [DESCRIPTION](#DESCRIPTION)

Strip last component from file name

# [OPTIONS](#OPTIONS)

[**-z**, **--zero**](#z)

separate output with NUL rather than newline

[**-h**, **--help**](#h)

Print help

[**-V**, **--version**](#V)

Print version

# [EXTRA](#EXTRA)

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

# [VERSION](#VERSION)

v(uutils coreutils) 0.12.0

2026-10-16

---

Document: dirname(1) from uutils 0.12.0-r4 (Chainguard OS)
Source: https://github.com/uutils/coreutils
