dirname is a standard computer program on Unix and Unix-like operating systems.
When dirname is given a pathname, it will delete any suffix beginning with the last slash ('/') character and return the result.
dirname is described in the Single UNIX Specification and is primarily used in shell scripts.
The version of dirname bundled in GNU coreutils was written by David MacKenzie and Jim Meyering.
[1] The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.