going back to directory

A useful tool is z. You could type z temp, and z would take you back to the temp folder. It uses some guesswork to work out where it thinks you want to go to, using an algorithm based on frequency and recency, but it almost always guesses correctly.


Use Push-Location and Pop-Location instead of cd (aka, Set-Location).

Or, if you just want to traverse up the directory heirarchy two levels, you can use cd ..\...


With Powershell Core 6.2.2 or later you can do cd - to navigate to your previous directory.

cd is the alias for Set-Location. Adding paramerter + or - goes forward or backward through your location history.

Powershell Docs - Set-Location

Tags:

Powershell