Skills › 💻 Terminal & git

Jump back with cd -

Toggle between your last two directories, like Alt+Tab for folders.

⏱ 15s

  1. You're in one directory and cd somewhere else.
  2. Run cd - to go straight back to where you were.
  3. Run cd - again to return. It swaps between the two each time.

Tip: git checkout - and git switch - do the same thing for branches.

Try it now: Run cd /tmp, then cd -, then cd - again, and watch the path it prints.

Practice in the feed →

Next crumbs

Sources