LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 03-05-2011, 06:22 PM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,662
Blog Entries: 1

Rep: Reputation: 242Reputation: 242Reputation: 242
Change bash prompt for user only


On my lfs system I have a prompt root [ ~ ] in red. The user has a prompt of -bash-4.1$. Is it possible to change the user prompt only to something else I,E hostname $. I know that this can be done temporary by
Code:
PS1="\h $"
I would like to leave root as it is, just change the user prompt, Which file do I need to edit? if it,s bashrc would that change it for root as well.
I have googled but cant find exact answer i,m looking for.
I would just like to say that this project has opened my eyes.

Druuna I take my hat of to you for the amount of effort & time you put in to helping ppl i Thank you
 
Old 03-05-2011, 06:44 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,647

Rep: Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524
Edit the user's .bashrc (in the user's home directory). root will not be effected.
 
Old 03-05-2011, 07:00 PM   #3
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
Assume root, and then:
Code:
echo "export PS1='\h:\w$ '" >> /home/USERNAME/.profile
Replace /home/USERNAME/ with the full path to the user's home directory.

Note that ~/.profile is only read by Bash if ~/.bash_profile and ~/.bash_login do not exist, and only one of the three is automatically executed during Bash startup. The order of precedence is as follows.
  • ~/.bash_profile
  • ~/.bash_login
  • ~/.profile

Bash Reference Manual, 6.2 Bash Startup Files

Edit:
This may only take effect at the user's next login.

Last edited by Telengard; 03-05-2011 at 07:08 PM.
 
1 members found this post helpful.
Old 03-06-2011, 02:56 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

@spiky0011: You "only" installed LFS, the goodies (including LFS configuration) are done in BLFS.

Have a look: BLFS, especially this chapter: 3 - After LFS Configuration Issues.

Hope this helps.
 
Old 03-06-2011, 03:58 AM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,662
Blog Entries: 1

Original Poster
Rep: Reputation: 242Reputation: 242Reputation: 242
Yes I have started on blfs thks druuna Dose that mean I cant ask qestions in this forum, if not then i,m sorry for posting here.
 
Old 03-06-2011, 04:00 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,
Quote:
Originally Posted by spiky0011 View Post
Yes I have started on blfs thks druuna
You're welcome

Quote:
Dose that mean I cant ask qestions in this forum, if not then i,m sorry for posting here.
Yep, all LFS (BLFS, CLFS, LFS etc) related questions can be asked right here.
 
  


Reply

Tags
bash, blfs, environment, lfs


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash prompt doesn't change from $ to # for su mike11 Linux - Newbie 7 01-25-2011 04:23 AM
help! bash command prompt font/color change richiangpan9 Linux - Newbie 3 04-24-2005 11:34 AM
make bash interactive and change prompt DropSig Linux - Newbie 3 05-17-2004 08:16 AM
put my user logon instead of bash prompt little_ball Slackware 10 04-13-2004 01:57 PM
How do I change the bash prompt in SuSE 8.2 Joey.Dale Linux - Distributions 3 12-08-2003 08:01 AM


All times are GMT -5. The time now is 06:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration