On one of my servers, the prompt is [user@host path]...and I can actually push "tab" to auto-fill the path.
But on my new Ubuntu server, it is just a dollar sign?
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
Since you are asking two questions, I'll answer both. Why doesn't tab autocomplete file paths?Because you shell either doesn't support it, or tab completion isn't turned on. To resolve this, you first need to discover what your shell is. On the machine whose shell you enjoy, run
You may see the common Now, you can change your shell on Ubuntu machine. On that machine, first make sure that the shell you want exists. Since the shell might not be in the same location on the Ubuntu machine as on the other, check the location by typing
This will give you the path of the shell you want, something like If you don't see a path, but instead see With the path of your chosen shell, you can finally change your shell by running
replacing Why is the prompt a dollar sign instead of [user@host path]?Because of your prompt environment variables
| |||
|
feedback
|
|
Bash is not the only shell. Your issue could be a simple matter of not having a .profile or .bashrc that sets PS1, or it could be that your login shell is not bash at all. Bash uses See | |||||||||
feedback
|
|
You need to set a variable called PS1 on one of your login script, for example /etc/profile or ~/.bashrc. It will depend on your distribution. Example: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html | |||
|
feedback
|
|
i guess, you are not using bash, but sh and your prompt is not set properly (if this is even possible with sh). you can get your current shell by typing: if you want to start bash, just type | |||||||||||||
feedback
|
pwdto print the name of the current working directory. And are you saying that Tab-completion is not working either? (On some machines I use, I get that short prompt only if I login as root, and I happily leave that in place as a nice warning. As one seldom, if ever, needs to login as root: you're not using root, are you?) – Arjan Nov 10 '09 at 10:27