Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've just installed Slackware on my machine and I'm wanting to change the bash prompt to display something other than the hostname. I've read that creating a .bashrc file in the /etc directory with the PS1 variable set in it will set the prompt universally. Is this correct?
I've tried it but I can't get it to work at all. I've even tried rebooting to see if the changes would be reflected then. The only thing I can do is change it dynamically...but not permanently.
Also, I want to change the hostname of my machine. How do you do this and make it permanent? Thanks in advance for the help.
ok a few things.
do export PS1='.......' and u should c your prompt change. of course replace those dots with wutever u want. now, this is only for that particular bash session. if u exit or open a new terminal, it'll go back to the default. want u want to do is to edit the .bashrc file in your homedirectoy. put the line export PS1='.....' in there, there should already b an existing PS1 entry in there so just edit. now, after saving and exiting, u need to do source ~/.bashrc and your prompt will change. the last thing u need to do is to check your .bash_profile file also in your home directory and u need in there source ~/.bashrc it may b commmented out, so just uncomment it. now u should b all set
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.