[101824] in RedHat Linux List
Re: Any FAQ's on colour ls?
daemon@ATHENA.MIT.EDU (Ramon Gandia)
Sun Nov 29 18:07:54 1998
Date: Sun, 29 Nov 1998 14:03:22 -0900
From: Ramon Gandia <rfg@nook.net>
To: redhat-list@redhat.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
John H Darrah wrote:
>
>
> Try:
> ls --color | less -r
>
> The "-r" causes raw data to be displayed.
You have to be a bit careful here if you are using bash for
shell, because in bash you cannot pass arguments to within
an alias.
The example above would work as far as that goes, but if
you create an alias like this:
alias xy="ls --color | less -r"
it will not work as intended. Example:
xy <----- this works, gives a colorized ls.
xy m* <----- this will NOT display files starting with m.
In fact, the behaviour of xy m* will be bizarre.
Here is another one that will NOT work:
alias xy=" ls --color $1 | less -r"
However, what you want to do can be implemented using a bash
function, for instance, in the /etc/bashrc file (or your
home dir ~rfg/.bashrc for example), put this line in:
function xy { ls -lA --color $1 | more }
that is the letter L lower case in -lA.
There are a few quirks, and I am sure you can use less -r instead
of more. Don't forget changes to bashrc take effect on the NEXT
login, not the current session.
--
Ramon Gandia ==== Sysadmin ==== Nook Net ==== http://www.nook.net
285 West First Avenue rfg@nook.net
P.O. Box 970 tel. 907-443-7575
Nome, Alaska 99762-0970 ======================= fax. 907-443-2487
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.