LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   No coloring for directories and files on SunOS (https://www.linuxquestions.org/questions/solaris-opensolaris-20/no-coloring-for-directories-and-files-on-sunos-4175639517/)

tfg99 10-01-2018 12:23 PM

No coloring for directories and files on SunOS
 
Hi all,

I have to ssh into a server at work (SunOS 5.10 Generic_147148-26 i86pc i386 i86pc), but when I do everything is colored the same way, so it's hard to see what's a file, directory, linked file etc. I'm used to using Ubuntu and Red Hat, which show colors automatically.

I've tried altering the bashrc file to make things colored with the code below, but it doesn't help. I'm guessing LS_COLORS isn't a SunOS thing?

LS_COLORS="$LS_COLORS:di=00;94:fi=00;33:ex=01;33:ln=01;36"
export LS_COLORS

I added the following code to change the color and style of my terminal prompt though, and that works:

export PS1="\[\033[00;95m\]\W \$ \[\033[0m\]"

If anyone can offer any help, that would be great!

Jack

jlliagre 10-01-2018 03:52 PM

LS_COLORS is a GNUism. You need to us GNU ls to get this functionality.

It might be installed or not under Solaris 10, have a look to /usr/sfw/bin/ls, /opt/csw/bin/ls, /usr/local/bin/ls and other potential freeware directories. Under Solaris 11, GNU ls is in /usr/gnu/bin.

Funnily enough, when I connect to a Linux system, one of the first things I do is to unset the ls alias to remove the annoying colors, especially the directories displayed in dark blue on black...

YesItsMe 10-11-2018 05:34 AM

As GNUisms will probably annoy you rather now than later, there's always colorls to save you:
https://github.com/athityakumar/colorls

syg00 10-11-2018 06:17 AM

I'm with @jlliagre - mindless colouring is mindless. More so if you use a white terminal. Not that I ever had a positive thing to say about SunOS when I had to use it.

scasey 10-11-2018 01:11 PM

It's been awhile since I worked on Sun systems, but I think the
Code:

-F, --classify
option applies there. Much more useful, IMO, than colors.

tfg99 10-24-2018 11:32 AM

Thanks for the help everyone. Yes, the -F option works, and adds a / and a * to directories and executable files respectively. That's the best that can be done. I don't care what anyone says though - colors are much much better! :)


All times are GMT -5. The time now is 04:35 PM.