Linux: Change working directory to script directory in bash


short post. You start a bash script and want to change the working directory to the directory where the script is stored

Use this:

cd "$(dirname "$0")"


Advertisment to support

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.