LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 04-24-2006, 01:44 PM   #1
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Rep: Reputation: 15
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!!
 
Old 04-24-2006, 01:47 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 77
Code:
$ export PS1="\u@\h:\w\$ "
 
Old 04-24-2006, 09:24 PM   #3
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Original Poster
Rep: Reputation: 15
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!
 
Old 04-24-2006, 09:30 PM   #4
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Original Poster
Rep: Reputation: 15
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!!
 
Old 04-24-2006, 11:37 PM   #5
vbisis
Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 250

Rep: Reputation: 34
Add this line to your /etc/profile, so it will always come true when you open a shell
 
Old 04-25-2006, 06:23 AM   #6
SlackTux
Member
 
Registered: Jul 2004
Location: Lisbon
Distribution: Slackware
Posts: 39

Rep: Reputation: 15
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.
 
Old 04-25-2006, 10:47 AM   #7
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Original Poster
Rep: Reputation: 15
Thumbs up 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!
 
Old 05-28-2006, 09:48 AM   #8
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
more great info here if you want to add color to your custom prompt.......

http://www-128.ibm.com/developerwork.../l-tip-prompt/
 
Old 09-08-2011, 07:41 AM   #9
bhavisavla
LQ Newbie
 
Registered: Aug 2011
Posts: 8

Rep: Reputation: Disabled
Question

Quote:
Originally Posted by SlackTux View Post
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?
 
Old 09-08-2011, 08:00 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,901
Blog Entries: 14

Rep: Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651Reputation: 1651
Hi,

Welcome to LQ!

Quote:
Originally Posted by bhavisavla View Post
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.
 
  


Reply

Tags
slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
Slackware 10.2: How do I change default font for shell? PastorFrederick Linux - Newbie 6 10-17-2005 10:10 PM
change the shell prompt ust Linux - Distributions 5 04-28-2005 03:26 PM
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 03:49 PM
How to change default root shell fessin Linux - General 2 02-13-2003 11:25 PM


All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration