dirname

From wikieduonline
Revision as of 04:25, 12 February 2024 by Welcome (talk | contribs)
Jump to navigation Jump to search

dirname [1] command included in coreutils package.

cd -- "$(dirname "$0")"
dirname -- "$0";
dirname -- "$( readlink -f -- "$0"; )";

Related terms

script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

See also

  • https://man7.org/linux/man-pages/man1/dirname.1.html
  • Advertising: