Here are a few examples of using the cd - command:
-
Example 1:
cd /home/user/documents cd /home/user/downloads cd - # This will take you back to /home/user/documents -
Example 2:
cd /var/log cd /etc cd - # This will take you back to /var/log -
Example 3:
cd /usr/local/bin cd /tmp cd - # This will take you back to /usr/local/bin
In each case, cd - allows you to quickly return to the last directory you were in, making navigation more efficient. Let me know if you need more information!
