LinuxQuestions.org
Register a domain and help support LQ
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 05-31-2012, 01:12 PM   #1
fatherwillow
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
change command line color


How can I change the font color of the command line?
 
Old 05-31-2012, 01:52 PM   #2
Jaysonfw
LQ Newbie
 
Registered: Apr 2010
Location: Chesapeake Virginia
Distribution: Slackware
Posts: 7
Blog Entries: 2

Rep: Reputation: 0
From http://www.cyberciti.biz/faq/bash-sh...linux-or-unix/
Add colors to the prompt
To add colors to the shell prompt use the following export command syntax:
'\e[x;ym $PS1 \e[m'

Where,

\e[ Start color scheme
x;y Color pair to use (x;y)
$PS1 is your shell prompt
\e[m Stop color scheme
To set a red color prompt, type the command:
$ export PS1="\e[0;31m[\u@\h \W]\$ \e[m "

List of Color code
Color Code
Black 0;30
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Replace digit 0 with 1 to get light color version.

Be careful! Goofing the escape codes can have very nasty or unpredictable result.
 
Old 05-31-2012, 02:02 PM   #3
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Squeeze
Posts: 585

Rep: Reputation: 119Reputation: 119
If you're using BASH, open your ~/.bashrc file and look for the following lines:
Code:
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
Uncomment the last line:
Code:
force_color_prompt=yes
This will give you a colored prompt.

To change the default colors edit this line:
Code:
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Use the codes from the previous poster.

You can set the default colors for the ls commands with the dircolors command. Other commands such as find have their own color options.

Hope this helps.
 
Old 05-31-2012, 02:09 PM   #4
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch
Posts: 424

Rep: Reputation: 18
Quote:
Originally Posted by fatherwillow View Post
How can I change the font color of the command line?
The first two answers relate to changing the color of your prompt, but not necessarily that of the text printed in the terminal. For that I googled <linux command line text color> and this is the first result
http://linux.byexamples.com/archives...-command-line/
 
Old 05-31-2012, 02:13 PM   #5
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
http://manual.siduction.org/en/term-...en.htm#colours
 
Old 06-01-2012, 07:27 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Rather than playing guessing games, it would be better to hold back a bit and wait for the OP to clarify what he means.

As you can see, a simple one-line question that can be interpreted several ways is not a good question. If you want to get good, clear answers quickly, describe what you want in some detail, along with other possibly-relevant details about your environment, such as your distro, shell, and the console program you use to run it in (if any).

Please read How To Ask Questions The Smart Way, and try again.
 
  


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
help! bash command prompt font/color change richiangpan9 Linux - Newbie 3 04-24-2005 12:34 PM
What is the command to change text color? BiO|Happy Mandriva 2 06-09-2004 03:54 PM
Changing color of command line interface JustinCoyan Slackware 1 05-28-2004 12:35 PM
ls command line, color and wildcards ioio85 Linux - Newbie 1 05-13-2004 06:01 AM
need to know system command to change text color Mr_ss Linux - General 2 06-22-2001 11:13 AM


All times are GMT -5. The time now is 06:04 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration