Visit Jeremy's Blog.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.


  Search this Thread
Old 10-01-2018, 12:23 PM   #1
LQ Newbie
Registered: Sep 2018
Posts: 18

Rep: Reputation: Disabled
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?

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!

Old 10-01-2018, 03:52 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,760

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
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...
Old 10-11-2018, 05:34 AM   #3
Registered: Oct 2014
Distribution: Gentoo
Posts: 529

Rep: Reputation: 195Reputation: 195
As GNUisms will probably annoy you rather now than later, there's always colorls to save you:
Old 10-11-2018, 06:17 AM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,625

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
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.
Old 10-11-2018, 01:11 PM   #5
Senior Member
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.5
Posts: 2,577

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
It's been awhile since I worked on Sun systems, but I think the
-F, --classify
option applies there. Much more useful, IMO, than colors.
Old 10-24-2018, 11:32 AM   #6
LQ Newbie
Registered: Sep 2018
Posts: 18

Original Poster
Rep: Reputation: Disabled
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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sub-Directories not picking up correct group permissions for new files/directories JockVSJock Linux - Newbie 4 05-07-2017 10:52 AM
[SOLVED] Turn off coloring files in Midnight Commander Mr. Alex Linux - Software 2 01-22-2012 06:49 AM
How to store files/directories in different different directories!! anishkumarv Linux - Newbie 7 03-23-2011 05:26 PM
bash ls not coloring files, directories etc mr_smith Red Hat 2 08-30-2006 07:05 AM
using SunOS plot files (1b or 4b format) in linux jkey Solaris / OpenSolaris 0 09-18-2005 06:14 AM > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration