Page 1 of 1

Terminal command - unreadable response. (solved)

Posted: Fri Sep 29, 2023 10:45 pm
by cobaka

G'day all and 'woof'
In the snapshot below you see a screen grab from the terminal window.

screen_grab_fr._terminal.jpg
screen_grab_fr._terminal.jpg (65.25 KiB) Viewed 416 times

The command (as you can see) is "ls" - list directory.
The output lists files and associates each file with a colour. directories -> blue. text -> black. *.pdf files -> an impossible to read fluorescent green.

I understand that 'ls' is a component of bash (the command-line interpreter) and may be difficult to modify.
Is there any way I can modify 'ls' to see/read impossible colours?

Tnx and woof
собака

PS - the green text seen in the screen-grab is more readable than the output direct to my screen.


Re: Terminal command - unreadable response.

Posted: Sat Sep 30, 2023 1:17 am
by MochiMoppel
cobaka wrote: Fri Sep 29, 2023 10:45 pm

Is there any way I can modify 'ls' to see/read impossible colours?

Yes, you can change the colors, but which colors are "impossible" to read depends on many factors. The blue directories (?) in your screenshot are easy to read because your terminal has a light gray background, but my terminal in BW64 has an almost black background, making it difficult for me to read blue text.

Personally I prefer to turn colors off for the ls command (ls --color=none), but to remedy the unreadable blue text I could also define new colors.

As an example I've added the line
LS_COLORS=$LS_COLORS:"di=1;34;47"
to the file /root/.bashrc

This still displays directories in blue (34) but adds a gray background (47), making it readable in any terminal

changing_ls_colors.png
changing_ls_colors.png (45.62 KiB) Viewed 396 times

If you use a search engine you'll find many explanations how to change colors, e.g. How to Change Colors for ls in Bash
Also I recommend to read the usage info for the ls command: ls --help
If you read to the end you will find a reference to the dircolors command, which allows you to see all file types and their ls colors: dircolors --print-ls-colors


Re: Terminal command - unreadable response.

Posted: Sat Sep 30, 2023 7:50 pm
by d-pupp

Is there any way I can modify 'ls' to see/read impossible colours?

If you set your LS_COLORS in ~/.bashrc it should override the system wide defaults set in /etc/profile
fi=color-code sets the file color