Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

By the way I'm on a Mac OS X but I'm connected to an Ubuntu Server.

Yesterday I installed a module for node.js(after a hour I deleted it) which asked me to add something to the .bashrc file and now when I log in with my mac terminal over SSH I see this as my connected name:

[e]0;u@h: wa][033[01;32m]u@h[033[00m]:[033[01;34m]w[033[00m]$

As I know .bashrc is a file which runs commands when I login, so I thought that this is the problem, so I read a little on the web and some guys recommended to get the original file from:

/etc/skel/.bashrc

so I copied this file over the running one:

cp /etc/skel/.bashrc /etc/bash.bashrc

Then I rebooted, and nothing happened. Everything works but my screen name is extremely ugly and I need to use the terminal a lot.

So what should I do?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The first file you should check is ~/.bashrc. "~" means your home directory. So you need to edit your own .bashrc file firstly, not system wide one. If you want to check the system wide one try /etc/bashrc.

In this file you will see a PS1 section. This is what manages the prompt view.

After editing PS1 line for your needs just run this command:

source ~/.bashrc

You don't need to reboot the system.

share|improve this answer
    
And is it good if I overwrite ~/.bashrc with /etc/skel/.bashrc? Just because I don't know what are the original configs. –  Ádám Nov 10 '11 at 11:46
    
Actually you don't need to overwrite it, just edit the PS1 section according to your needs. You can find lots of howto about that. But, if you want to overwrite it you can do this of course. When you log in, first your own .bashrc file is being read. If there is not, the system wide one used. –  heartsmagic Nov 10 '11 at 11:50
    
I can't even enter to the file with vi -i ~/.bashrc because it gives me a lots of errors –  Ádám Nov 10 '11 at 11:52
    
Ok I overwritten with /etc/skel/.bashrc and now it works, thanks very much for pointing out the right .bashrc file! and the source command –  Ádám Nov 10 '11 at 11:54
    
I am glad that it worked. Probably your .bashrc file corrupted somehow. –  heartsmagic Nov 10 '11 at 11:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.