Re: Bash equivalent to DOS /p
On Fri, Jul 16, 2004 at 10:30:53PM +0800, Duggan wrote:
> Kirk Strauser wrote:
>
> >On Friday 2004-07-16 08:59 am, Duggan wrote:
> >
> >
> >
> >>I know that this is a really n00bish question, but I have to ask. What
> >>is the command that limits output from a command to just a page at a
> >>time, like the /p command in DOS?
> >>
> >>
> >
> >less (or more). As in, instead of running
> >
> > $ command
> >
> >you pipe it's output into less (or more):
> >
> > $ command | less
> >
> >Et voila! You get the output one page at a time.
> >
> >
> Okies, I get it now
>
> Thanks
>
> Elijah
That works for regular output. However, some programs also emit
error messages onto stderr. The above command will *not* redirect
error messages into less, so they might mess up the pagination.
To get error messages piped through less, use
command 2>&1 | less
-- hendrik
Reply to: