cd

cd

Using cd is a script does not change the directory in the shell environment that called the script.

If you want to call a script and have it affect your environment, you must source it instead.

my_script.sh:

#/bin/bash
cd /home/user/my_target_directory

then source it:
$ . ./my_script.sh

or source it from your .bashrc.

Syndicate content