DEV Community

Discussion on: How to cd to a directory with a space in the name?

 
brandinchiu profile image
Brandin Chiu

When moving through your file system, if you add the forward slash, then your system will think your path starts from your system root.

For example, say you are in your home directory at: /Users/Morgan.

If you type cd frontend, then this is equivalent to /Users/Morgan/frontend.

If instead you type cd /frontend, then this is equivalent to /frontend.

Adding the / turns your path into an "absolute path". Without it it is a "relative path".

Thread Thread
 
codandcode profile image
Marmot

And with that you just made it absolutely clear. Thanks again!