DEV Community

Discussion on: Get to Know the Command Line: Basic Commands

Collapse
 
patricnox profile image
PatricNox

Something super useful but not widely known, is " cd - "

// ~/
$ cd docks/proj/src/component

// ~/docks/proj/src/component
$ (something useful)

// ~/
$ cd -

Also, just "cd" is same as "cd ~" which brings you to the home dir.✔️

Collapse
 
torianne02 profile image
Tori Crawford

As I stated in the other comment, I had no idea cd - was a thing before reading the discussion. I can think of multiple different times I accidentally cded somewhere when I didn't want to and had to type everything out again. This is going to be a nice time saver!