Sektionen
Benutzerspezifische Werkzeuge
Sie sind hier: Startseite Support Dokumentation docs howto change and export colors of directory listings in debian

howto change and export colors of directory listings in debian

Colored directory listong in the console are very helpful to get a overview of different file types. But the standard coloring scheme does not work very well with e.g. a yelloish console background. Here you find a solution how to change the colors of the different filetypes easily and also how to export these colors to other servers.

Changing the color scheme

 

Exporting the color scheme

dircolors -p > ~/.dircolors

Now you may edit the well docomented newly create file .dircolors

I changed e.g.

EXEC 01:32 

to

EXEC 00:32 

and changed so the intense green to dark green.

To activate the new colorscheme you have to modify you local .bashrc file

# You may uncomment the following lines if you want `ls' to be colorized:
 export LS_OPTIONS='--color=auto'
 eval "`dircolors`"

to load the config file

# You may uncomment the following lines if you want `ls' to be colorized:
 export LS_OPTIONS='--color=auto'
 eval "`dircolors ~/.dircolors`"

Now reload your .bashrc file

volker@client:$ . ~/.bashrc

and you will see your new color scheme.

 

Exporting your color scheme to servers you access via ssh

 

If you have no root acces to the server you will have to make the adjustments you did locally in your account on the server too.

But if you have root access you may change the server to accept you local color scheme.

On the server modifiy /etc/ssh/sshd_config

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

to accept our LS_COLORS and LS_OPTIONS environment variables

# Allow client to pass locale environment variables
AcceptEnv LANG LC_* LS_*

Restart the ssh daemon on your server

server:# /etc/init.d/ssh restart

On the client modify your /etc/ssh/ssh_config

#   PermitLocalCommand no
    SendEnv LANG LC_*

to

#   PermitLocalCommand no
    SendEnv LANG LC_* LS_*

You will have to login newly into the server to make him accept your color scheme.