Terminal command - unreadable response. (solved)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
cobaka
Posts: 572
Joined: Thu Jul 16, 2020 6:04 am
Location: Central Coast, NSW - au
Has thanked: 94 times
Been thanked: 63 times

Terminal command - unreadable response. (solved)

Post 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 414 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.

Last edited by cobaka on Mon Oct 02, 2023 6:29 am, edited 1 time in total.

собака --> это Русский --> a dog
"c" -- say "s" - as in "see" or "scent" or "sob".

User avatar
MochiMoppel
Posts: 1233
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 437 times

Re: Terminal command - unreadable response.

Post 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 394 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

d-pupp
Posts: 335
Joined: Tue Nov 22, 2022 9:11 pm
Location: Canada
Has thanked: 188 times
Been thanked: 52 times

Re: Terminal command - unreadable response.

Post 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

Post Reply

Return to “Users”