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.
via Wikipedia infobox
dirname
pubs.opengroup.org →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.
~1 min read
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.
Excerpt from a page describing this subject · 8,154 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).