bash : cd : 参数太多

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47351933/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 22:37:15  来源:igfitidea点击:

bash : cd : too many arguments

bashcdquoting

提问by Veerabala J

I'm new to Ubuntu. I tried to open a file with name which has space in it. I used cd command. it shows bash : cd : too many arguments

我是 Ubuntu 的新手。我试图打开一个名称中有空格的文件。我使用了 cd 命令。它显示bash : cd : 参数太多

Whenever a file name has a space in it. It is showing this error. What should I do?

每当文件名中有空格时。它显示此错误。我该怎么办?

回答by Sora.

Use quotes:

使用引号:

cd "new folder"

or escape the space:

或逃离空间:

cd new\ folder

(That being said, cddoes not open a file but changes the working directory.)

(也就是说,cd不会打开文件,而是更改工作目录。)