Difference between revisions of "Dirname"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<code>dirname</code> command included in <code>coreutils</code> package.")
 
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>dirname</code> command included in <code>[[coreutils]]</code> package.
+
{{lowercase}}
 +
<code>dirname</code> <ref> https://man7.org/linux/man-pages/man1/dirname.1.html</ref> command included in <code>[[coreutils]]</code> package.
 +
 
 +
[[cd]] -- "$(dirname "$0")"
 +
 
 +
dirname -- "$0";
 +
 
 +
dirname -- "$( [[readlink]] -f -- "$0"; )";
 +
 
 +
== Related terms ==
 +
* <code>[[basename]]</code>
 +
* <code>[[PATH]]</code> [[environment variable]]
 +
* <code>[[mkdir -p]]</code>
 +
* <code>[[mkdir -p]] "$(dirname "$1")" && [[touch]] "$1"</code>
 +
* <code>[[BASH_SOURCE]]</code>
 +
* <code>script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)</code>
 +
 
 +
== See also ==
 +
* {{coreutils}}
 +
* {{Bash}}
 +
 
 +
[[Category:Linux]]

Latest revision as of 10:12, 28 March 2024

Advertising: