LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-05-2003, 06:22 AM   #1
jcornel7
LQ Newbie
 
Registered: Feb 2003
Location: Michigan
Distribution: Red Hat 8
Posts: 16

Rep: Reputation: 0
Question Questions about bash colors....


OK I admit it I am new to linux. The question i am sking has no use but for me to look cool. (Just Kidding)

Anyways...

obvisouly my prompt now says user@hostnname dir

How do I keep the exact same prompt but with a blue background and bold yellow text. (University of Michigan Student)

Then how do I keep that permanent for who ever logs in?

Thanks for your help!!!
 
Old 02-05-2003, 08:16 AM   #2
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Rep: Reputation: 146Reputation: 146
look for "current profile" or "edit profile" in one of the drop menus on top bar of terminal window

all colours etc are changed from there
 
Old 02-05-2003, 10:18 AM   #3
jcornel7
LQ Newbie
 
Registered: Feb 2003
Location: Michigan
Distribution: Red Hat 8
Posts: 16

Original Poster
Rep: Reputation: 0
Ummm.....Yes I am aware on how to do it in X. However i am strictly taking in a terminal session. I dont run X.
 
Old 02-05-2003, 10:29 AM   #4
peeples
Member
 
Registered: Sep 2002
Location: Wichita Falls, TX
Distribution: tried a lot of 'em, now using kubuntu
Posts: 180

Rep: Reputation: 30
Look in either your .bashrc or your .bash_profile
One or the other should have "PS1="

This is your prompt.

Now do a google search for "ASCII codes", somewhere you will find color codes. Insert the color codes in right after the equals sign in your PS1 statement. Right now I have a yellow prompt for a normal user, and a red prompt for root. I'm not sure about how to change the background color, but maybe you will find that info when searching for the ASCII codes.

To make this work for all users, you will have to do the changes to the bash configuration file that is located (I think) in /etc.
Also, you may have to add the change to /etc/skeleton (or somesuch), so that it will be active for all newly created users. To make changes for root user, change it in /root/.bashrc.

HTH

Last edited by peeples; 02-05-2003 at 10:33 AM.
 
Old 02-05-2003, 11:40 AM   #5
jcornel7
LQ Newbie
 
Registered: Feb 2003
Location: Michigan
Distribution: Red Hat 8
Posts: 16

Original Poster
Rep: Reputation: 0
Do you have any specific syntax? (I am a newbie)
 
Old 02-05-2003, 01:34 PM   #6
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
function normal() { echo -en "\033[m\017"; }
function red() { echo -en "\033[1;31m"; }
function green() { echo -en "\033[1;32m"; }
function blue() { echo -en "\033[1;34m"; }
function lilac() { echo -en "\033[1;35m"; }
function cyan() { echo -en "\033[1;36m"; }
function white() { echo -en "\033[1;38m"; }
function bold() { echo -en "\033[m"; }

Only cos you're now In future, use google power.
 
Old 02-05-2003, 01:35 PM   #7
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
oh.... so PS1="\033[1;36m"

that controls foreground colours only. man tput for more info, i think that'll cover bg colours
 
Old 02-05-2003, 02:13 PM   #8
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: 78
Read the bash prompt howto:
http://www.shelluser.net/~giles/bash...wto/book1.html

Should answer all your questions.
 
  


Reply


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
Bash scripting questions stryka Programming 3 11-24-2005 11:46 PM
Bash colors ryedunn Mandriva 0 12-09-2004 08:50 AM
Bash scripting questions irfanhab Programming 2 06-07-2004 12:13 PM
bash colors, wan't white, not gray king8 Red Hat 2 10-12-2003 11:27 PM
bash prompt colors emetib Linux - Software 3 06-14-2003 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:28 AM.

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
Open Source Consulting | Domain Registration