Lỗi driver cd cant match with current os

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

  • bash
  • cd
  • quoting

asked Nov 17, 2017 at 13:38

Veerabala JVeerabala J

5631 gold badge5 silver badges14 bronze badges

2

  • Either put the file name in quotes or escape the spaces so that bash knows it's one string: cd 'long file name' or cd long\ file\ name. The problem is not unique to Ubuntu. If you were in a Windows command shell you'd have the same issue. Nov 17, 2017 at 13:41
  • The problem is unique to bash 4.4; its implementation of "cd" is buggy. The manual page bash(1) specifies that " Any additional arguments following dir are ignored." The OP's command should go to directory "exception" and ignore "handling". Instead it throws an error. This is a bug. I tried bash 4.2, where "cd" works correctly. Apr 7, 2021 at 18:09

1 Answer

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.)

answered Nov 17, 2017 at 13:41

Lỗi driver cd cant match with current os

Sora.Sora.

1,4251 gold badge12 silver badges14 bronze badges

2

  • This is what I was looking for Jan 13, 2021 at 19:41
  • Can this be saved in variable or alias? E.g. NF="new\ folder"; cd $NF Aug 19, 2022 at 7:45

  • The Overflow Blog
  • Featured on Meta

Linked

Related

Hot Network Questions

  • Can I insulate my brick garage walls with 2x4 furring strips?
  • The Law Commands Women Keep Silent
  • Distillation thermometer position
  • Does China have no homeless people?
  • Can I decline a professor's request for video conferencing?
  • Deciding to not apply to a college that I have met with a faculty member, advice on what to do
  • Why does Sacred Flame specify that the target gets no benefit from cover?
  • 80% of respondents agreed…
  • PSE Advent Calendar 2023 (Day 4): A few of my favo(u)rite things
  • Rearrange file content to prepend record 'header' line to each record 'body' line
  • Are PhD programmes reluctant to admit multiple students from the same university in the same application cycle?
  • Is "stife" a name for smoking cooking oil?
  • What type of topological space is this?
  • Jury and Witness intimidation
  • Is it "unscientific" to be sceptical without offering alternative explanations?
  • How much cash do I need to enter Singapore?
  • Accidentals and ornaments
  • Why are journals so pesky about partial submissions?
  • Why do we use hypothesis tests instead of just letting people do bayesian updates?
  • How to write an SQL query where the count of 2 different attributes is the same?
  • Why did Yehuda/Shelah need Yibum with Tamar? She had a Chazaka
  • "..........down 1,445 on the previous year." Why is it ""....on the previous year." but not ""....from the previous year."
  • Negotiated conditions not met after taking back resignation
  • End of long rest vs finishing long rest

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.