0

I have simple problem that I have to long directories which I want to cd into, but I would like to know easy way.

mosquito@mosquito-K56CB:~/Downloads$ ls | grep Guns
Guns n' Roses - Appetite for Destruction (Japanese Edition) 1987
Guns n' Roses - Use Your Illusion I 1991

Of course I can just copy the name and put it like this: cd "Guns n' Roses - Appetite for Destruction (Japanese Edition) 1987"

But why when I write cd Guns then tab, it finishes line into: cd Guns\ n\'\ Roses\ -\ then by my understanding I should just start writing App.. with tab and it should finish whole name, but it does not. And hitting tab twice does not show me anything either. What I am missing here?

user1880405
  • 866
  • 6
  • 14
  • 28

1 Answers1

1

EDIT: Actually trying the same directory names in bash, I get the same error. Removing the ' from the directory names makes it work, so I'm guessing that this is a bug in the bash tab-completion.

EDIT 2: According to this question, it's a known bug that will be fixed in a future release.

You could still try zsh as a drop-in replacement and install the Grml zsh config, which really takes you to a whole new level of tab completion:

sudo apt-get install zsh
wget -O ~/.zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
wget -O ~/.zshrc.local  http://git.grml.org/f/grml-etc-core/etc/skel/.zshrc
zsh

If you like it and want to use it as your default shell, run chsh -s /usr/bin/zsh.

kraxor
  • 5,627