From My Virtual Desktop: color and contrast

1:56 PM
From My Virtual Desktop: color and contrast

- Hello fellow Citrites, customers and community members

On this Super Bowl Sunday, a customer (you know who you are) asked me quite a wonderful question :

"I can not stand the color on the command line for directories in the console: the blue is so difficult to see is it possible to change it. "

for the customer (and to you), yes - you can change the colors of the terminal as this is a" Linux thing [1945004?] ". The colors to identify the directories, symbolic links, and so on have been around as long as I can remember, but I understand the need / want it that looks like this:

Can look / feel like that ... especially if ongoing access to SSH or some virtual consoles tools:

Immediately, I felt the fiber channel connections in my skull warm up to new mental storage -Add Repositories I had long forgotten. After a few seconds, I made a note of what I wanted to share an aesthetic based on "How To" so you can fool your experience XenServer command line.

1. The configuration file

The color definitions for the console are stored in / etc / DIR_COLORS. From the command line, run the following command so you can start tweaking the text colors to your liking:

cd ~

cp / etc / DIR_COLORS ~ / .dir_colors

what we just did was copy the global file color definition in the original root or as .dir_colors /root/.dir_colors. This will allow comprehensive color definitions to keep in touch and to keep the changes for the root user ... specific to the root user.

2. The file contents

Let's take a look at the file and where you are looking to make changes: You can edit this file with nano or vi:

nano .dir_colors

or

vi .dir_colors

at the top there are some gibberish stuff. What we seek (see below) is in the middle of .dir_colors file:

 # Here is the color init strings for the basic types of files. Color # initialization string consists of one or more of the following numeric code: code # Attribute: # 00 = no fat 01 = 04 = 05 = Flashing point 07 = Reverse 08 = # hidden text color codes: # 30 = black 31 = red 32 = green 33 = yellow 34 = blue 35 = magenta 36 = cyan 37 white = # Background color codes: # 40 = black 41 = red 42 = green 43 = yellow 44 = blue 45 = magenta 46 = cyan 47 = white 

this is the key to change the colors that these comment lines are your "Instructions"! How? Well, there are three aspects to "colors" in the console:

- Attributes, or style of the text

- foreground color

- Color bottom

later in the file, we find the core definitions of terminal colors. These variables are explained in the file and, at minimum, must have some sort of attribute applied to it :.

NORMAL # 00 overall by default, although everything should be something
# 00 FILE normal file
DIR 01; 34 # directory
lINK 01; 36 # symlink
FIFO 40; 33 # pipe
SOCK 01; 35 # socket
BLK 40; 33; device driver block 01 #
CHR 40; 33; # 01 device driver character
01 orphans; 05; 37; 41 # syminks orphans
MISSING 01; 05; 37; # 41 ... and files they point to

# This is for files with execute permission:
EXEC 01; 32

3. Changing the color attribute, Foreground

SO, I want my directory colors to be visible and easier on the eyes. I'll change the DIR variable so that the color is brown ...! To do this, I change the line to DIR:

DIR 01; 33 # directory

I save the file and exit the text editor. To test my colors and see if the directories appear as brown, I type:

exit

This allows me to return to the command line and from there, I can run:

ls /

... and my directories are no longer dark blue ...

now I feel like a mad scientist! If you think you messed up or forgot what the original colors were worth, you can always re-copy / etc / DIR_COLORS Back to the original root directory by running:

cd ~

cp / etc / DIR_COLORS ~ / .dir_colors

4. Other

the lower part of .dir_colors file allows you to specify colors for the extensions specific files! Yup ... feel like Bob Ross? I know what I do:

Now, this is going a little crazy ... but this is what I changed in my .dir_colors file:

NORMAL 00; 34; # 45 overall by default, although everything should be something
file 00 ;. 34; 45 # regular file
DIR 01; 36; 45 # directory
lINK 01; 36; 45 # symlink
FIFO 40; 33 # pipe
SOCK 01; 35 # socket
BLK 40; 33; # 01 block device driver
CHR 40; 33; # 01 device driver character
ORPHAN 01; 05; 37; 41 # syminks orphans
MISSING 01; 05; 37; # 41 ... and files they point to

# This is for files with execute permission:
EXEC 00; 37; 45

.SH 01; 37 ;. 45

And this is my virtual office for you

-jkbs

@VerbalJesse

Previous
Next Post »
0 Komentar