Reputation: 43
How to create a folder witha a folder name containing spaces in linux?
For Example, folder name should be "Stack OverFlow".
Upvotes: 2
Views: 16760
Reputation: 114
you can also do mkdir Stack\ OverFlow
the \
does the same thing as " "
but it is easier. so you can do stuff like mkdir Stack\ OverFlow\ is\ Great
. you can manipulate that folder using the \
as well. so things like cd Stack\ OverFlow
and rm -rf Stack\ OverFlow
.
Upvotes: 7
Reputation: 289795
Just use quotes around the name:
mkdir "this is my dir"
Then you can check it by also using quotes:
$ ls -ld "this is my dir"
drwxr-xr-x 2 me me 4096 Aug 17 11:59 this is my dir
Upvotes: 1