Linux - NewbieThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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!
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
Quote:
xterm -fg red -bg green
(quite a painful combination, but just to give you the idea )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.