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 |
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. |
|
 |
01-09-2009, 05:03 AM
|
#1
|
|
LQ Newbie
Registered: Jan 2009
Posts: 3
Rep:
|
Change colors in Bash background and text
How can I change the background to be black and text color to be green or cyan in bash? How can I change the colors so that when I type in "ls" I will see files to be green, and directories to be blue and executables to be red? Then, if I change to superuser, how do I make the colors work for the superuser?
|
|
|
|
01-09-2009, 05:40 AM
|
#2
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
Quote:
|
How can I change the colors so that when I type in "ls" I will see files to be green, and directories to be blue and executables to be red
|
add this to .bashrc
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi
Also take a look at
http://www.google.com/search?q=bashr...nt=iceweasel-a
|
|
|
|
01-09-2009, 05:44 PM
|
#3
|
|
LQ Newbie
Registered: Jan 2009
Posts: 3
Original Poster
Rep:
|
Repo, this worked to give some colors for the "ls" command, but it does not let me to set what color I want. How can I modify it to get any color that I want to have?
Repo, I will take a look at the link to see if I can find something to set the background color and the text color for the Bash program.
[EDIT] Repo, if I make a file for the dircolors then I can make my own colors for the ls command. That solves that part.
Last edited by janslinuxq; 01-09-2009 at 09:45 PM.
|
|
|
|
01-09-2009, 05:49 PM
|
#4
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
Quote:
|
How can I modify it to get any color that I want to have?
|
If you use gnome-terminal, you can set it in the profile
right click in the terminal => edit current profile
|
|
|
|
01-09-2009, 05:51 PM
|
#5
|
|
Member
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896
Rep:
|
Is that what you want?
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/
Also, you can change the colors in the output of ls --color by editing /etc/DIR_COLORS on most distributions.
|
|
|
|
01-09-2009, 09:43 PM
|
#6
|
|
LQ Newbie
Registered: Jan 2009
Posts: 3
Original Poster
Rep:
|
Found this old link from 2004 that does not work for me since I do not have xtermset or .Xdefaults. Repo, for the Gnome terminal I did find that I can set a profile and a window pops up that allows me to change any settings bash. Repo, from your links, it looks like it is called a console. I can save the profile and then next time that I open a gnome terminal it will go back to the default profile and I have to then manually reselect the profile that I saved.
Isn't there a way to make these same settings in the bashrc file so that it will work each time I start bash? I could not find out what to put into the bashrc file to set the background color and text color and prompt color. There was a lot of links telling how to set the color of text in the console, but nothing on how to set the profile like you can in the window for the gnome terminal. What file does the gnome terminal make when you create those settings? And, how do I make the settings different for the superuser? With bashrc I can have different settings!
Uncle, that lets me change the bash prompt. I want to change the entire color of the console!
Also found this post.
[EDIT] The gnome terminal profile background color and foreground color is based on the system theme. What file has these settings?
The gnome terminal profile uses a default profile. What file sets this?
Last edited by janslinuxq; 01-09-2009 at 10:23 PM.
|
|
|
|
01-09-2009, 10:46 PM
|
#7
|
|
Member
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896
Rep:
|
OK, first, let's make it clear. Do you want to change background and foreground colors in a terminal emulator _under X_ (in GUI, like KDE or GNOME), *or* do you want to change background/foreground in bare console, without X?
If former, you can try things like
(quite a painful combination, but just to give you the idea  )
If the latter, you have two ways of going about it.
First, if you're using framebuffer for the console, you should read this thread. Read it to the end. http://osdir.com/ml/linux.fbdev.user.../msg00008.html
If you don't use the framebuffer, then the prompt how-to is actually the only way you can have different colors.
|
|
|
|
01-10-2009, 07:39 AM
|
#8
|
|
Member
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289
Rep:
|
the right-click-on-terminal then edit profile settings should work and is set only once, probably you are logging from a different machine?
|
|
|
|
| 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 12:56 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
|
|