In a bash shell script today I noticed the below command at the end of the script. I know what is cd but I am unaware of the significance of a dash after it.
cd - What does this mean? Google naively truncates the - so I am unable to find its answer.
compact disc (CD)
A certificate of deposit (CD) is a savings product that earns interest on a lump sum for a fixed period of time.
CD stands for Calendar Day.
If a single dash is specified as the argument, it will be replaced by the value of OLDPWD.
The OLDPWD is set by cd command and it is the previous working directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With