Skip to content
Advertisement

How can I 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?

Advertisement

Answer

You need to quote the directory name:

cd 'Magical Island'

or escape the space character:

cd Magic Island
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement