3 ms·
The author missed to mention one of my favorite tricks to change back in to the last visited directory: cd - Hint: Change into directory called '-' can be d
by sandreas 6y ago
The author missed to mention one of my favorite tricks to change back in to the last visited directory:
cd -
Hint: Change into directory called '-' can be done by
cd ./-
I also use the mkcd alias / function:
mkcd() { mkdir -p "$@" && cd !$; }
This allows creating multiple dirs and cd into the first one.
mkcd test1 test2 test3
- alanwreath 6y agocd - is there, it’s one of my favs too
- hinkley 6y agoI don't think this is documented anywhere that I've found, but git checkout - checks out the previous branch you were on, similar to cd -
- secondstring 6y agoBig fan of git-aliasing this to `git back`. I actually use it a ton and that small amount of extra chars plus the "-" makes a pretty decent difference for me.
- aj12ay 6y agoSpeaking of extra characters, I'm pretty far in with the `git` commands. `git checkout` -> `g c`, `git status` -> `g s`. I usually do `g c -` but I guess `g back` wouldn't be bad.