How can I set
-P flag to every
cd command? I do that every time. There are LS flag environment variable which I could use for
ls command so I wonder can
-P be set as default?
Open the file
/home/your-username/.bashrc and add the following line to the end:
alias cd='cd -P'
Open a new terminal, and try using
cd to see if it worked for you.
set -o physical
set section in
The option-name can be one of the following:
Same as -P.
-P If set, the shell does not follow symbolic links when executing commands such as cd that change the current working directory. It uses the physical directory structure instead. By default, bash follows the logical chain of directories when performing commands which change the current directory.