Monika
Monika

Reputation: 45

Ubuntu terminal: strange symbols instead of my username

I have a strange problem with my Ubuntu terminal: when I open it instead of seeing my username I see this:

32m]u@h[033[00m]:[033[01: command not found
31m]w[033[00m]$: command not found
’[033[01

Strangely enough bash commands work normally, the terminal just does not show my username or the current path. I googled, but was unable to find any answers. The most recent changes I made on my computer involved installing RVM (Ruby Version Manager) and manually editing the PATH to add RVM in files: .bash_profile, .profile and .bashrc, but after that it all worked normally, so I am not really sure that could be the reason.

Upvotes: 0

Views: 695

Answers (1)

AJefferiss
AJefferiss

Reputation: 1689

It looks like you've edited the PS1 variable by mistake when modifying the ~/.bashrc, which controls the prompt layout. You'll need to edit your ~/.bashrc and replace it with the following default.

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

For more information on other changes you can make to your prompt have a look at Customising Bash Prompt. The change wouldn't appear immediately after modifying the file because bash doesn't reload it's configuration once you've changed the file automatically. You'll either need to exit the shell and start a new one or reload the configuration using

. ~/.bashrc

The . at the begining is needed, it's shorthand for the source command.

Upvotes: 2

Related Questions