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?
2 Answers
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.
Try this,
set -o physicalFrom the set section in man bash,
-o option-name
The option-name can be one of the following:
...
physical
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.