Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 2.34 KB

DIRNAME.1.md

File metadata and controls

66 lines (49 loc) · 2.34 KB

DIRNAME(1)

NAME

dirname - return directory portion of pathname

SYNOPSIS

dirname string [...]

dirname [-z] string [...]

DESCRIPTION

The dirname utility deletes the filename portion, beginning with the last slash '/' character to the end of string (after first stripping trailing slashes), and writes the result to the standard output.

OPTIONS

Options Use
-z|--zero End each output line with NUL, not newline
--debug Enable debug mode
--help|-? Print usage and a short help message and exit
--version Print version and exit
-- Options processing terminator

ENVIRONMENT

Contrary to the original FreeBSD dirname command, this version takes the POSIXLY_CORRECT environment variable into account, disabling all the command's options except the options terminator (--).

EXIT STATUS

The dirname utility exits 0 on success, and >0 if an error occurs.

SEE ALSO

basename(1) csh(1), sh(1), dirname(3)

STANDARDS

The dirname utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.

This version is fully compatible with the FreeBSD version (apart from the help and error messages). It also implements the GNU coreutils version specific options ( -z --zero ).

It tries to follow the PEP 8 style guide for Python code.

PORTABILITY

Tested OK under Windows (though with backslashes instead os slashes, of course).

HISTORY

The dirname utility first appeared in 4.4BSD.

This version was made for the PNU project in order to test the b2bt command.

LICENSE

This utility is available under the 3-clause BSD license.

AUTHORS

This version was written by Hubert Tournier.

The man page is derived from the FreeBSD project's one.