I have recently installed ubuntu hardy and found that shell command completion with TAB doesn't work, the package 'bash-completion' is installed in my system. I guess it is related to dash being the default shell? Is there a way to use tab completion in dash? If there isn't a way then how can i change my default shell to bash?
3 Answers
Dash shouldn't be the default user shell. That would make life much less convenient, because bash is way more usable in interactive sessions. You can check what shell you're actually running with echo $SHELL
.
Have a look at /etc/bash.bashrc
around line 32. Uncomment the enabling configuration.
-
It's also enabled (or can be) on a per-user basis in
~/.bashrc
Oct 24, 2009 at 18:27 -
If he added his account (i.e. not the first account made), using adduser instead of useradd, I believe it defaults to sh. Oct 24, 2009 at 20:11
-
Thanks Novelocrat, uncommenting at /etc/bash/bash.rc solved the problem– TutulOct 25, 2009 at 7:49
I believe sh is actually symlinked to /bin/dash in Ubuntu. There is no tab completion support with this shell. To set your shell to bash use the following command:
sudo usermod -s /bin/bash username
-
Thank you Kyle, for your response. But changing the shell didn't solve it, i had to edit /etc/bash/bash.rc– TutulOct 25, 2009 at 7:49
-
Very strange, I've never had to do that with any Ubuntu version, but I do see the code in bash.bashrc. Oct 28, 2009 at 14:06
-
/bin/sh is symlinked to /bin/dash To change it, do: sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh
-
2I don't think "correct it" is the right phrase. "Change it" would be better. The ubuntu folks wrote up something explaining why they changed the symlink for sh to point to dash instead of bash wiki.ubuntu.com/DashAsBinSh . It looks like bash is better for interactive site and dash is faster for running shell scripts. Mar 12, 2010 at 14:49
-