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
cd - brings you back to the last directory.
cd -
$ cd ~/Desktop $ pwd /Users/daknok/Desktop $ cd / $ pwd / $ cd - $ pwd /Users/daknok/Desktop