You are not logged in.

#1 2011-01-17 20:31:40

zia.newversion
Member
Registered: 2011-01-17
Posts: 8

New User Here: Changing the color scheme of console

Hi there...
My name is Zia and I am from Pakistan. I am primarily a Ubuntu user. But I needed a lightweight console-only operating system specifically for some work in Intel Assembly and a few other things which do not need X. Someone told me Arch was what I was looking for. So I installed Arch base as guest on VirtualBox and so far, it is impressively. It is running on mere 128M physical and 4GB pre-allocated HDD with very nice results. I did hack away with a few things and set the basic configs up myself. That's no big deal since I have a little background knowledge of how Linux works, from my experience with Ubuntu. Ubuntu, however is a little more resource hungry so I am going for Arch on VM.

Enough with my boring chatter. I am here to ask help. Please direct me.

The console looks pretty boring. I changed the console font while installing and I think I can change it again in /etc/rc.d if I want, but the font looks good. The major problem is colors. I googled it and there are plenty of threads specifying how to change the background/foregriund colors of TTY. But that is not what I want. You see, when I list the contents of the directory, I want all the sub-directories to be listed in blue, all the executables in green and rest of the normal files simply white or grey, whatever... The problem is, I am not sure how I would do that.

Someone at some thread mentioned an .Xdefaults. I didn't come across such a file tampering with my Ubuntu box so naturally I am not familiar with it. If that is what I need to master before in order to get what I want, I shall need links or on-thread help, please.

Thanking in anticipation. Zia

EDIT: I have not installed X. Just the base system with samba and a few other things. Should the .Xdefaults still control the console colors? I am not talking about the terminal inside X. I am talking about TTY.

Last edited by zia.newversion (2011-01-17 20:33:57)

Offline

#2 2011-01-17 20:33:55

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: New User Here: Changing the color scheme of console

I think this is what you seek:

ls --color=auto


you can make an alias in your shell's config file.

Offline

#3 2011-01-17 20:38:06

zia.newversion
Member
Registered: 2011-01-17
Posts: 8

Re: New User Here: Changing the color scheme of console

Yes, thank you very much.
It works.

I could make an alias but since I am used to "ls", I would like this "color=auto" param to stick with the original "ls". Is that possible?

Offline

#4 2011-01-17 20:50:47

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: New User Here: Changing the color scheme of console

The "ls" command in Ubuntu is an alias.

Offline

#5 2011-01-17 20:59:19

Awebb
Member
Registered: 2010-05-06
Posts: 6,285

Re: New User Here: Changing the color scheme of console

If you alias "ls" to something like "ls --meh --bla --mycommand", it will work. The alias does not call itself in a recursive way or something alike.

Offline

#6 2011-01-17 21:15:46

zia.newversion
Member
Registered: 2011-01-17
Posts: 8

Re: New User Here: Changing the color scheme of console

drcouzelis wrote:

The "ls" command in Ubuntu is an alias.

Thank you. I didn't know that.

Offline

#7 2011-01-17 21:16:28

zia.newversion
Member
Registered: 2011-01-17
Posts: 8

Re: New User Here: Changing the color scheme of console

Awebb wrote:

If you alias "ls" to something like "ls --meh --bla --mycommand", it will work. The alias does not call itself in a recursive way or something alike.

Can you please explain how I would do that?

Offline

#8 2011-01-17 21:39:05

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: New User Here: Changing the color scheme of console

echo "alias ls='ls --color=auto'" >> ~/.bashrc

That will append the alias mentioned in post 2 to your .bashrc which is where aliases are stored (you should run this as user for user's bashrc and root for root's bashrc). You will need to logout or issue

source ~/.bashrc

to get it to work.

For example I've aliased ls to ls -sh to give me file sizes

edit: fixed typo

Last edited by SS4 (2011-01-17 21:39:35)


Rauchen verboten

Offline

#9 2011-01-17 21:40:55

greyscale
Member
From: Sweden
Registered: 2011-01-02
Posts: 59

Re: New User Here: Changing the color scheme of console

A little tip if you don't like the default colors used.

Run:

 dircolors -p > ~/.my_dircolors

This will save the default color-scheme in .my_dircolors, then edit the file (the comments in the file will help you).

When your done you can load the new settings with (assume your using bash):

eval `dircolors -b ~/.my_dircolors`

And if your happy then just add it to your login-script.


A tiling window manager simply manages your windows, not just letting you have em
:: Configs etc @GitHub

Offline

Board footer

Powered by FluxBB