user3450695 user3450695 - 15 days ago 8
Linux Question

How to go to a directory whose file name has spaces between them in the linux terminal

I am trying to go to a directory whose file name has spaces between them in the linux terminal. I tried doing this:

cd Magical Island
bash: cd: Magical: No such file or directory


As you can see, it didn't work

How can I make it work? Thanks!

Answer

You need to quote the directory name:

cd 'Magical Island'

or escape the space character:

cd Magic\ Island

Have fun there!