Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-24-2006, 01:44 PM
|
#1
|
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Rep:
|
I'd like to change the default shell prompt.
Slackware10.2 default PS1 prompt is "bash-3.00#". I'd like to change it to '\u@\h:\w\$ ' like it shows in /etc/profile. I've tried 'declare -x' & other stuff I'd rather not mention. I don't want to change shells, just the default prompt. Thanks for any help!! 
|
|
|
|
04-24-2006, 01:47 PM
|
#2
|
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Rep:
|
Code:
$ export PS1="\u@\h:\w\$ "
|
|
|
|
04-24-2006, 09:24 PM
|
#3
|
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Original Poster
Rep:
|
I'm pretty sure I've tried that, but it only stays true in that shell. If I open another window I'm back to the 'bash-3.00#'. I'll give it another try w/o the '-x'. Seems to be the same kind of problem as changing or adding to my PATH. BUILTINS rule.
But I'll try. Thanks!
|
|
|
|
04-24-2006, 09:30 PM
|
#4
|
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Original Poster
Rep:
|
default shell prompt
Quote:
|
Originally Posted by bulliver
Code:
$ export PS1="\u@\h:\w\$ "
|
I'm pretty sure I've tried that but it only changes that shell. If I open another one I'm back to where I started. Something to do w/ BUILTINS? Same problem changing my PATH. The change isn't permanent. I'll give it another shot anyway. Thanks!!
|
|
|
|
04-24-2006, 11:37 PM
|
#5
|
|
Member
Registered: Dec 2005
Distribution: Slackware
Posts: 250
Rep:
|
Add this line to your /etc/profile, so it will always come true when you open a shell
|
|
|
|
04-25-2006, 06:23 AM
|
#6
|
|
Member
Registered: Jul 2004
Location: Lisbon
Distribution: Slackware
Posts: 39
Rep:
|
Go to the ~HOME folder of all the users you wants to change and edit (or create if it doen't exists) the file called .bashrc and add the '\u@\h:\w\$ ' there.
|
|
|
|
04-25-2006, 10:47 AM
|
#7
|
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Original Poster
Rep:
|
default shell prompt
Quote:
|
Originally Posted by SlackTux
Go to the ~HOME folder of all the users you wants to change and edit (or create if it doen't exists) the file called .bashrc and add the '\u@\h:\w\$ ' there.
|
That's the one that did it!! I put the export PS1="\u@\h:\w\$ " into .bashrc and it worked like a charm. Thanks SlackTux and Bulliver!
|
|
|
|
09-08-2011, 07:41 AM
|
#9
|
|
LQ Newbie
Registered: Aug 2011
Posts: 8
Rep: 
|
Quote:
Originally Posted by SlackTux
Go to the ~HOME folder of all the users you wants to change and edit (or create if it doen't exists) the file called .bashrc and add the '\u@\h:\w\$ ' there.
|
how do i change my prompt to a particular string, for example my name?
|
|
|
|
09-08-2011, 08:00 AM
|
#10
|
|
Moderator
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 10,339
|
Hi,
Welcome to LQ!
Quote:
Originally Posted by bhavisavla
how do i change my prompt to a particular string, for example my name?
|
Please do not resurrect old threads especially if you do not provide anything relative.
Please re-read LQ Rules;
Quote:
- Do not post if you do not have anything constructive to say in the post.
- When posting in an existing thread, ensure that what you're posting is on-topic and relevant to the thread. If the content of your post will interfere with the current discussion, you should start a new thread.
|
If you have a problem then create a new thread with your problem. Be sure to provide relative information so we can aid in solving the issue(s).
FYI: I suggest that you look at 'How to Ask Questions the Smart Way' so in the future your queries provide information that will aid us in diagnosis of the problem or query.
HINT: Do a LQ Search with keywords 'bashrc prompt' produces several helpful threads/posts. One of my posts may help.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:53 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|