• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

konsole problem

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JayP

Member
Joined
Oct 23, 2001
Just recently I have noticed that when I start the Konsole Terminal it shows me as user "bash-2.05$" This is not the user name that I have logged into when I started my system. I'm not too sure when this changed and don't seem to find any other ways of fixing it.
 
whoami

ok

when i typed " whoami " it gives the correct user name

but it still says " bash-2.05$ " at prompt...

does this have anything to do with me changing my hostname for the computer?
 
To change the prompt to [username]$, edit .bashrc in you home dir, and change the line PS1= bash-2.05$ to PS1=[\u]$.
There are some other fun things you can add to the prompt. Here's an explanation of what you can put in PS1 to change your prompt. To add a normal char, just type it in with all the literals, and bash will figure it out. Just don't get carried away. There's not much point in having a prompt that takes up a whole line. :D
 
i can't find the line " PS1= bash-2.05$ to PS1=[\u]$. " in my .bashrc file

can i just add that line in at the bottom?
 
problems!!!

ok, i can't seem to find the .bashrc file in my home directory.

where exactly is that file supposed to be?

i even logged in as root and searched for all .bachrc files in /home and edited them all...

still didn't change anything in the konsole.
 
By default, the command ls won't display files and directories whose names start with a dot. (Many other tools also do this.) To force it to display them, use type ls -a (a = show all files), and it'll tell you if there's a .bashrc. If you're running bash and there's no .bashrc file in your home directory, make an empty one. Then add PS1=[\u] to it, save, and close the console window. Open another, and the change will take effect.

The ~/.bashrc (~ is your home dir) file is a script that's executed each time you log in to a console. The PS1 variable tells the console what the prompt is supposed to look like. If you want to change the prompt, and have it return to normal when you open another console window, you can type PS1=[/u]$ at the prompt, and it will change immediately.


If you think you'll be using Linux as more than a hobby, you'll find a good reference/tutorial book invaluable. We're all on these forums to find and give help, but a book is the best way to get the basics down (YMMV). I recommend "A Practical Guide to Linux" by Mark Sobell.
 
Christoph

Thanks! works fine now... but one last question before I go to Chapters and buy that book:

The konsole doesn't seem to show the path of which I am going through.

For example: Should show -- [user@local Folder]$
But shows -- [user@local]$
 
JayP said:

The konsole doesn't seem to show the path of which I am going through.

For example: Should show -- [user@local Folder]$
But shows -- [user@local]$


From that link:

\w the current working directory
\W the basename of the current working directory

Try one of those.
 
You can use PS1=[\u@\h \w]$ to get [user@computer dir]$ or [\u@\h \W] to get [user@computer /home/user/dir]$.
Once you get used to it, try changing it around a little. The beauty of Linux is that you can make it what you want it to be. The sooner you experience that, the better your experience will be.

I hope you learn lots from that book, and I hope to see you around here more in the future!
 
Back