Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Dec 2006 14:35:30 -0600
From:      "Eric Kjeldergaard" <kjelderg@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Is there UNIX analog of ftp command pls?
Message-ID:  <d9175cad0612211235x6e4ab98cg18e3a195796f6698@mail.gmail.com>
In-Reply-To: <20061221194409.GA1515@host.my.domain>
References:  <20061219195359.GA34750@host.my.domain> <20061221184535.GB40028@dan.emsphone.com> <20061221194409.GA1515@host.my.domain>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/21/06, a@zeos.net <a@zeos.net> wrote:
>
> On Thu, Dec 21, 2006 at 12:45:35PM -0600, Dan Nelson wrote:
> > In the last episode (Dec 19), a@zeos.net said:
> > > Is there UNIX analog of ftp command pls, i. e. ls | less ?
> >
> > Yes, "ls | less" is the way to do it.  You can add a shell alias to
> > make it easier to type:
> >
> >   alias pls="ls -l | less"
> >
> > That's for bourne-style shells (sh,bash,zsh).  for csh, you would use
> >
> >   alias pls "ls | less"
> >
> > Another way to do it would be to write a script named pls and put it in
> > your path:
> >
> >   #! /bin/sh
> >   ls "$@" | less
> >
> > --
> >       Dan Nelson
> >       dnelson@allantgroup.com
>
> Thank you for response, but I know how to write aliases and bash scripts.
> I just thought, I don't know the standard way.
>
> Apropos,
>   alias pls="ls -l | less"
> is not a proper way, because of the command
>
> pls directory
>
> will give
>
> ls -l | less directory
>
> which is not what one want.


To find the answer to this, you need only  look at  both of those solutions
and combine them.  For instance...

alias pls="ls -l $@ | less"




-- 
If I write a signature, my emails will appear more personalised.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d9175cad0612211235x6e4ab98cg18e3a195796f6698>