简体   繁体   English

如何在Linux中使用文件夹名称创建包含空格的文件夹?

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

How to create a folder witha a folder name containing spaces in linux? 如何在Linux中使用文件夹名称创建包含空格的文件夹?

For Example, folder name should be "Stack OverFlow". 例如,文件夹名称应为“ Stack OverFlow”。

you can also do mkdir Stack\\ OverFlow the \\ does the same thing as " " but it is easier. 您也可以执行mkdir Stack\\ OverFlow\\" "做同样的事情,但是更容易。 so you can do stuff like mkdir Stack\\ OverFlow\\ is\\ Great . 因此您可以执行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 . 诸如cd Stack\\ OverFlowrm -rf Stack\\ OverFlow

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM