change directory bash code example

Example 1: bash change to script directory

cd "$(dirname "${BASH_SOURCE[0]}")"

Example 2: change directory in linux

# if u want to change folder please use this command
#use pwd command to see where the location is 
#then use "cd" to move to other folder
cd <folder name u want to move>
ex => cd Documents/python/
#if u dont have linux then use "git bash"

Example 3: bash script change directory run a command

#!/bin/sh
cd "$1" && shift && "$@"

Example 4: bash script change directory run a command

cd DIRECTORY_HERE; COMMAND_WITH_ARGS_HERE