Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: ls colorful



> A possible improvement would be
>    alias ls="ls --color=auto"
> which will disable color output if the output is not a terminal.
> 
> Shimpei.
 
Right, Except then if I want to look at a really big directory and pipe the
output through more, I lose my colored output (more's not a terminal).

Here's what I do to have my cake and eat it, too:

	export LS_OPTIONS='--color=auto'
	export LS_PG_OPTIONS='--color'
	eval `dircolors /etc/lscolors`     # I had to change the colours 
								# because I couldn't read 
								# blue on black very well
	alias ls='ls $LS_OPTIONS'
	alias l='ls $LS_OPTIONS -l'
	alias la='ls $LS_OPTIONS -A'
	alias ll='ls $LS_PG_OPTIONS -l $* | more'
	alias lla='ls $LS_PG_OPTIONS -lA $* | more' 

There's probably a better way to do this, of course. 

john
-- 
jseebach@example.com
--
--------------------------------------------------------------------
Next Nomikai Meeting: February 18 (Fri) 19:00 Tengu TokyoEkiMae
Next Technical Meeting:  March 11 (Sat) 13:00 Temple University Japan
* Topic: TBD
--------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links