Skip to content
EntityQ292084· pop 18· linked from 211 articles

dirname is a shell command for extracting the directory path portion of a path, without the last name. The command is specified in the Single UNIX Specification and is primarily used in shell scripts.

Key facts

Software.name
dirname
Software.developer
Various open-source and commercial developers
Software.programming language
C
Software.operating system
Unix, Unix-like, IBM i
Software.platform
Cross-platform
Software.genre
Command
Software.license
coreutils: GPLv3+

via Wikipedia infobox

Described at

Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The definition of pathname specifies implementation-defined behavior for pathnames starting with two characters. Therefore, applications shall not arbitrarily add characters to the beginning of a pathname unless they can ensure that there are more or less than two or are prepared to deal with the implementation-defined consequences. The EXAMPLES section of the basename () function (see XSH basename ) includes a table showing examples of the results of processing several sample pathnames by the basename () and dirname () functions and by the basename and dirname utilities. This would not work for the versions of these utilities in early proposals due to the way processing of trailing characters was specified. Consideration was given to leaving processing unspecified if there were trailing characters, but this cannot be done; XBD Pathname allows trailing characters. The basename and dirname utilities have to specify consistent handling for all valid pathnames.

Excerpt from a page describing this subject · 8,154 chars · not written by Vinony

Wikidata facts

Image
Dirname example.png
Show 1 more fact
Sources (3)

via Wikidata · CC0

~1 min read

Article

6 sections
Contents
  • Usage
  • Examples
  • Performance
  • See also
  • References
  • External links

dirname is a shell command for extracting the directory path portion of a path, without the last name. The command is specified in the Single UNIX Specification and is primarily used in shell scripts.

The version in GNU Core Utilities was written by David MacKenzie and Jim Meyering. The command is available for Windows as part of the GnuWin32 project and UnxUtils and is in IBM i.

Connections

Categories