How to create a folder with a folder name containing spaces in linux?

与世无争的帅哥 提交于 2019-12-25 19:30:35

问题


How to create a folder witha a folder name containing spaces in linux?

For Example, folder name should be "Stack OverFlow".


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/38993454/how-to-create-a-folder-with-a-folder-name-containing-spaces-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!