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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Since you are asking two questions, I'll answer both.
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
/bin/bash, or something less common like
/bin/zsh or something else entirely.
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
/usr/local/bin/bash. Of course, if you want a shell other than bash, you'll say
which zsh, or similar.
If you don't see a path, but instead see
bash not found, then you'll need to install the appropriate package, and again use
which to find out where the shell was installed.
With the path of your chosen shell, you can finally change your shell by running
chsh -s /bin/bash
/bin/bash with whatever the appropriate path for your shell of choice is.
Because of your prompt environment variables
$PS2, and so on. These things don't tend to be portable between shells, so here's a few links for likely candidates:
export PS1='[\u@\h \w] '
set prompt='[%n@%m %~] '
export PS1='[%n@%m %~] '
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.
gnu readline for things like tab completion. This is a complicated subject and readline even has its own per-user config file.
man sh, and
man 3 readline. Bash responds to
--version. On many linux systems,
/bin/sh is not actually bash, but usually a crippled version of
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.