dirname

From wikieduonline
Jump to navigation Jump to search

dirname 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

Advertising: