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.
Hi All,
I have my bash prompts set to PS1="[\t][\u@\h:\w]\$ in my /home/user directory with a .bashrc, it works for the user. But I just don't know how to do it for the root. I made one .bashrc file at /root and at /home, both wont work. Any clue? Thanks!
hmm, i didn't put the export PS1 under PS1="[\t][\u@\h:\w]\$. I will try it tonight. My user is showing the prompt nicely, only the root is not, strange. Thanks for your reply.
yes, both work fine with me... maybe there's something going on in your /etc/zprofile file, that's a system-wide profile configuration, contains some bash prompt stuff also (they are exported there too)
can't u change that one?
What happens when you source your ~/.bashrc? Tye source ~/.bashrc and see if your prompt changes to the one you specified. If so your problem is that it's just not executed when you log in.
Make sure your .bashrc is sourced (executed) from your ~/.bash_profile. In the latter you should have lines approximately like these:
Code:
if [ -e ~/.bashrc ]
then
source ~/.bashrc
fi
This will make the commands in your .bashrc always are executed.
hakan, thanks, the source works, but my .bash_profile doesn't help. I created a .bash_profile at my home directory but the prompt is still showing bash-2.05b# rather than my preferred:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.