orts Posted November 12, 2007 Report Share Posted November 12, 2007 Hi All How can I change the name in konsole from bash-3.2$ to [orts@localhost] $? like it was in the older versions of Mandriva. I find this pretty annoying, because when I change to another directory, I can't see that I really are in the wanted directory. If I'm logged in as admin in konsole I have the old "name" [root@localhost] # and can see which directory I'm working in at the time. like this [root@localhost orts] # I really hope that someone can help me, this is the only thing that I find is wrong with Mandriva 2008. [moved from Software by spinynorman] Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 12, 2007 Report Share Posted November 12, 2007 I'm not booted in Linux now, but this is usually set in .bash_profile from what I remember. I'll have to check my system when I next boot into it, unless someone beats me to it. Either that or /etc/profile or something. It's a combination of prompt=$whatever, or similar to get that output you desire. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 12, 2007 Report Share Posted November 12, 2007 Something like this: if [ -n "${BASH_VERSION}" ]; then # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 # including color. We leave out color here because not all # terminals support it. if [ -f /etc/bash/bashrc ]; then # Bash login shells run only /etc/profile # Bash non-login shells run only /etc/bash/bashrc # Since we want to run /etc/bash/bashrc regardless, we source it # from here. It is unfortunate that there is no way to do # this *after* the user's .bash_profile runs (without putting # it in the user's dot-files), but it shouldn't make any # difference. . /etc/bash/bashrc else PS1='\u@\h \w \$ ' fi else # Setup a bland default prompt. Since this prompt should be useable # on color and non-color terminals, as well as shells that don't # understand sequences such as \h, don't put anything special in it. PS1="`whoami`@`uname -n | cut -f1 -d.` \$ " fi will do it. From my /etc/profile in Gentoo, but should more or less be the same. Compare your Mandriva distros. Alternatively look at the bashrc file. Quote Link to comment Share on other sites More sharing options...
scarecrow Posted November 12, 2007 Report Share Posted November 12, 2007 (edited) http://bbs.archlinux.org/viewtopic.php?pid=293904 It's not explicit to store the info to .bashrc, but it's the simplest way. Edited November 12, 2007 by scarecrow Quote Link to comment Share on other sites More sharing options...
orts Posted November 12, 2007 Author Report Share Posted November 12, 2007 I have tried to compare /etc/bashrc and /etc/profile in Mandriva 2008.0 and Mandriva 2007.1. And they look exactly alike, I really cant find anything written in another way. Now I do belive the problem are somewhere els, any ideas? Quote Link to comment Share on other sites More sharing options...
ilia_kr Posted November 12, 2007 Report Share Posted November 12, 2007 (edited) If you want to change "localhost" to something else, you have change your PC's host name in mcc, don't remember where exactly (i don't use mandriva), but it should be somewhere in network>>alter misc' network options. P.S. I use a LAN connection so that might not work for you here how it looks in PCLinuxOS: Edited November 12, 2007 by ilia_kr Quote Link to comment Share on other sites More sharing options...
scarecrow Posted November 12, 2007 Report Share Posted November 12, 2007 It's about the (hidden) .bashrc file at your user's folder... not in /etc. Quote Link to comment Share on other sites More sharing options...
neddie Posted November 13, 2007 Report Share Posted November 13, 2007 Here's my entry in ~/.bashrc : # customize prompt PS1='\[\033[1;33m\]\u \W $ \[\033[0m\]' I don't care about localhost, that's where I always am, so I've just got username \u and working directory \W. The rest of it just makes the prompt yellow so it stands out from all the other text in the console. This is assuming you do mean the command prompt, or do you really mean the title of the window? Quote Link to comment Share on other sites More sharing options...
orts Posted November 13, 2007 Author Report Share Posted November 13, 2007 Thanks for all your help. Of some reason the .bashrc file, didn't excist in my home folder, so I installed Mandriva 2007.1 in Virtualbox, and copied the .bashrc from 2007.1 to Mandriva 2008, and now it works. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.