Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: ls colorful
- To: tlug@example.com
- Subject: Re: tlug: ls colorful
- From: Shimpei Yamashita <shimpei@example.com>
- Date: Wed, 19 Jan 2000 21:20:05 +0900
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=iso-2022-jp
- In-Reply-To: <E12Aqrx-0002Ii-00@example.com>; from John Seebach <jseebach@example.com> on Wed, Jan 19, 2000 at 05:53:37PM +0900
- References: <20000119034007.882E2405A@example.com> <E12Aqrx-0002Ii-00@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
You(John Seebach) wrote: > > A possible improvement would be > > alias ls="ls --color=auto" > > which will disable color output if the output is not a terminal. > 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). Ah. I'm a "less" kind of a person, and less doesn't let escape codes through by default, so this didn't occur to me. > 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. There Is More Than One Way To Do It. (That's the perl mantra, actually, but you get the idea.) Anyway, here are two ideas: bash or zsh shell function: function ml { ls --color=yes $* | more } tcsh alias: alias ml 'ls --color=yes \!* | more' Bourne shell script: $ cat > ~/bin/ml #! /bin/sh exec ls --color=yes $* | more ^D They basically do the same thing, except that you can't use the tcsh alias version of ml within other macros and the shell script version is available no matter what shell you are using. -- Shimpei Yamashita <http://www2.gol.com/users/shimpei/> -------------------------------------------------------------------- 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
- Follow-Ups:
- Re: tlug: ls colorful
- From: John Seebach <jseebach@example.com>
- References:
- Re: tlug: ls colorful
- From: shimpei@example.com
- Re: tlug: ls colorful
- From: John Seebach <jseebach@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: OpenSSH
- Next by Date: Re: tlug: OpenSSH
- Prev by thread: Re: tlug: ls colorful
- Next by thread: Re: tlug: ls colorful
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links