Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash : cd : too many arguments [closed]

Tags:

bash

quoting

cd

if i need to go to my directory named as"exception handling" then i write (cd exception handling) but it gives error too many arguments

like image 331
Veerabala J Avatar asked Nov 17 '17 13:11

Veerabala J


People also ask

What does too many arguments mean in Ubuntu?

Solve bash: cd: too many arguments Error in Bash If no argument is given, the cd command behaves as if the directory named in the HOME environment variable was specified as the argument. If the directory you want to go to consists of more than one word and contains spaces, you should not give it an argument directly.

What does too many arguments mean?

If you're seeing the "too many arguments" error, chances are you're getting a string from a function with unpredictable output.

What is cd in bash?

The cd (“change directory”) command is used to change the current working directory in Linux and other Unix-like operating systems.

How many arguments can be passed to bash script?

NUM} ) in the 2^32 range, so there is a hard limit somewhere (might vary on your machine), but Bash is so slow once you get above 2^20 arguments, that you will hit a performance limit well before you hit a hard limit.


1 Answers

Use quotes:

cd "new folder" 

or escape the space:

cd new\ folder 

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

like image 60
Sora. Avatar answered Sep 17 '22 19:09

Sora.