Contributed by jason on from the double-rainbow-omg dept.
Mark Solocinski has kindly given us permission to reprint one of his recent blog posts. This is a nice quick tip for getting color "ls" output in your terminal.
Want to add some color to your shell environment? FreeBSD and most Linux distros have color options included in the "ls" utility by default. OpenBSD doesn’t but but it’s very easy to add. We just need to install the colorls package (sysutils/colorls in ports).
# pkg_add colorlsColorls works exactly the same as regular "ls". To get the color option you just need to use the -G option. If you want it to replace "ls" for regular work you can create an alias in your favorite shell’s environment file. The output for file and directory listings will now have a different color for different types of files.
White = regular file Purple = directory Red = executable file Magenta = symbolic link White highlight = Set Group ID enabled Red highlight = Set User ID enabled Yellow highlight = Sticky bit enabledEnjoy! Almost as good as getting the window seat at work.
(Comments are closed)
By Bryan Brake (brakeb) on
Comments
By bnadland (bnadland) on
Personally, it is one of the early things I install on a fresh OpenBSD box. I prefer to see at a glance what is a directory and what is not.
But, as with my Syntax Highlighting in $EDITOR, I prefer not to much distraction so I export LSCOLORS=Aaxxxxxxxxxxxxxxxxxxxx in my .profile to only show the directories (Aa) in a different color and keep all else (x..x) at the terminal default.
Comments
By Anonymous Coward (bnadland) on
> But, as with my Syntax Highlighting in $EDITOR, I prefer not to much distraction so I export LSCOLORS=Aaxxxxxxxxxxxxxxxxxxxx in my .profile to only show the directories (Aa) in a different color and keep all else (x..x) at the terminal default.
I meant LSCOLORS=AaxxxxxxxxxxxxxxxxAaAa
Comments
By Bryan Brake (brakeb) on
> > But, as with my Syntax Highlighting in $EDITOR, I prefer not to much distraction so I export LSCOLORS=Aaxxxxxxxxxxxxxxxxxxxx in my .profile to only show the directories (Aa) in a different color and keep all else (x..x) at the terminal default.
>
> I meant LSCOLORS=AaxxxxxxxxxxxxxxxxAaAa
>
>
Or you could just 'ls -la' and look for a 'd' at the beginning of every line
-rw-r--r-- 1 root wheel 578B Nov 9 02:44 .cshrc
-rw-r--r-- 1 root wheel 411B Nov 9 02:44 .profile
drwxr-xr-x 2 root wheel 512B Nov 9 02:44 altroot
drwxr-xr-x 2 root wheel 1.0K Feb 20 11:21 bin
-r-xr-xr-x 1 root wheel 43.8K Nov 10 14:48 boot
I see 2 directories... weird...
By phessler (phessler) on http://theapt.org
>
> Personally, it is one of the early things I install on a fresh OpenBSD box. I prefer to see at a glance what is a directory and what is not.
>
> But, as with my Syntax Highlighting in $EDITOR, I prefer not to much distraction so I export LSCOLORS=Aaxxxxxxxxxxxxxxxxxxxx in my .profile to only show the directories (Aa) in a different color and keep all else (x..x) at the terminal default.
ls -F
By Bridau Fuzz (bridau) fuzz@imaginatif.org on http://www.imaginatif.org/
Where are the looney tunes ?
Come on.
Comments
By jason (jason) on http://undeadly.org/
Comments
By Francois Bridau (bridau) on http://www.imaginatif.org/
purple:ports {215} make search key=ls | awk '/color/ && /Path/ { print $0 }'
Path: devel/ruby-color-tools
Path: sysutils/colorls
Path: sysutils/colortail
By Daniel Bolgheroni (dbolgheroni) on
>
> Where are the looney tunes ?
>
> Come on.
People whining here doesn't realize this is _an option_. Yes, you can still use your regular 'ls'.
Comments
By Chris Bennett (chrisbennett) on www.bennettconstruction.us
> >
> > Where are the looney tunes ?
> >
> > Come on.
>
> People whining here doesn't realize this is _an option_. Yes, you can still use your regular 'ls'.
Actually, I like nice full displays so I alias ls="colorls -Gla'
I also find it better to have colors for newbies. But that is also a bad learning curve.
So instead of typing ls, which is aliased, I tell them to type colorls to get normal ls! SO I can have both! HA!
By Janne Johansson (jj) on http://www.inet6.se
> >
> > Where are the looney tunes ?
> >
> > Come on.
>
> People whining here doesn't realize this is _an option_. Yes, you can still use your regular 'ls'.
Since this news item is the first in a while to draw 12 comments, it must mean colorls definately means something for people, hate or love as they may.
If one post would go "obsd ported to Z5673 zOMG-CPUs that runs infinite loops in 12 minutes and are so fast they need two HALT instructions to stop" noone even posts a "imagine a beowulf cluster of those"-joke, but colorls brings in all the comments. That must really mean something.
By Jona Joachim (jaj) jaj-undeadly@hcl-club.lu on
export TERM=wsvt25
By Thomas Pfaff (tpfaff) tpfaff@tp76.info on http://www.tp76.info
LSCOLORS="gxxxxxxxcxxxxxxxxxxxxx"
I'd like to be able to color broken symbolic links but that feature seem to be missing.