Re: Bash equivalent to DOS /p
On Fri, Jul 16, 2004 at 03:58:41PM -0400, Nori Heikkinen wrote:
> on Fri, 16 Jul 2004 01:46:30PM -0400, Hendrik Boom insinuated:
> > 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
>
> dude! i've been trying to do that for months. tahnks!
>
> as an aside, did /p in DOS redirect stderr, too? it's been so long
> ...
Well, I'm glad I posted -- I nearly didn't -- it seemed too well-known.
But then I thought, piping to less is well-known, too.
I wonder how many other well-known things need to be posted here too....
I wonder how many of them I need to know and don't...
You're welcome.
-- hendrik
Reply to: