Re: [newbie] manage command-line scroll

2001-09-05 Thread Ron Bouwhuis


--- Peter Rymshaw <[EMAIL PROTECTED]> wrote:
> Thanks everyone re: the | more solution. I thought
> that only worked inside a file. 

Important Unix concept here.  Unix has 3 default
"files" for every command.  These are: stdin (standard
input), stdout (output) and stderr (error).  Every
command you run opens these three automatically. 
Usually stdin is your keyboard, while stdout and
stderr are your screen.  

You have the power to redirect these to wherever you
want when you invoke a command.  That's what > and <
do (with filenames!).  > directs stdout to a file,
while < says that stdin is to come from a file.  The
fact that stderr is different is cool - for example, a
find command from / will return access errors for
unmounted filesystems.  If you use >, those error
messages till come to the screen, while stdout happily
goes to the file.  (in fact, you can redirect stderr
too: just use 2>).

These 3 "files" are ALWAYS opened.  Commands that take
filenames as arguments often re-use one or more of
these.  For example, cat file1 will display the
contents of file1.  But if you type in cat by itself,
it looks like nothing happens - except your command
prompt has disappeared!  In fact, what's happened is
that it's opened stdin (by default) and will display
the contents.  Try it.  You can then type something in
and whenever you hit Enter it will display what you
type!  Use Ctrl-C to exit.

A pipe (i.e. |) simply connects stdout from the
command to the left of | to stdin command to the
right.  The command more file1 is just like cat file1
(of course, with screen pauses) - what I mean is that
if you type in more by itself, it expects input from
stdin.  That's why locate | more works - since more
doesn't have an argument which tells it the file to
display, it draws its input from stdin.  The pipe has
linked stdin to stdout from the locate command.

Of course, this is an ENORMOUS subject - pipes and
redirection are the guts of Unix and is where it draws
its true power.  (My first day on VMS: "Hey, how do
you do a pipe here???").  

I've tried to make this as clear as possible in as few
words as possible.  There a tons of reference material
out there, but I'm just trying to explain the
underlying concept here.  Understand this concept and
Unix suddenly will become a LOT clearer!

Regards,
Ron.

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] manage command-line scroll

2001-09-02 Thread Peter Rymshaw

Thanks everyone re: the | more solution. I thought
that only worked inside a file. Using the scroll bar
in KDE term is even better. Don't know how I missed
that.

Thanks.

--- d <[EMAIL PROTECTED]> wrote:
> LURKER, here again.  I find the "locate" command
> works great in a 'term' 
> just fine.  There is a scroll bar usually on the
> right side of the window 
> when accessing from KDE, BTW you can put that scroll
> bar on the left side 
> under "Options" if you like.
> 
> At 03:09 PM 9/2/01, you wrote:
> >Isn't there some way to control the way that
> >information is spewed out (more than a screenfull)
> in
> >Linux? I find the "locate" command so much better
> than
> >doing "Find" with KDE. but I don't know how to stop
> it
> >from scrolling off the page before I can read it.
> 
> And if you also like you can do " locate [the info
> you need] | (pipe 
> symbol) more", WFM. HTH!
> 
> >I know that there are things like "less" for text
> >files, but don't know of anything that works on the
> >command line itself. I'm thinking of something like
> >DOS's /w and /p.
> >
> >Thanks anyone.
> >
> >Pete R.
> >
> >Want to buy your Pack or Services from
> MandrakeSoft?
> >Go to http://www.mandrakestore.com
> 
> TIA,
> 'd'
> [EMAIL PROTECTED]
> San Antonio, Texas
> 
> 
> > Want to buy your Pack or Services from
MandrakeSoft?
> 
> Go to http://www.mandrakestore.com
> 




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] manage command-line scroll

2001-09-02 Thread d

LURKER, here again.  I find the "locate" command works great in a 'term' 
just fine.  There is a scroll bar usually on the right side of the window 
when accessing from KDE, BTW you can put that scroll bar on the left side 
under "Options" if you like.

At 03:09 PM 9/2/01, you wrote:
>Isn't there some way to control the way that
>information is spewed out (more than a screenfull) in
>Linux? I find the "locate" command so much better than
>doing "Find" with KDE. but I don't know how to stop it
>from scrolling off the page before I can read it.

And if you also like you can do " locate [the info you need] | (pipe 
symbol) more", WFM. HTH!

>I know that there are things like "less" for text
>files, but don't know of anything that works on the
>command line itself. I'm thinking of something like
>DOS's /w and /p.
>
>Thanks anyone.
>
>Pete R.
>
>Want to buy your Pack or Services from MandrakeSoft?
>Go to http://www.mandrakestore.com

TIA,
'd'
[EMAIL PROTECTED]
San Antonio, Texas




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] manage command-line scroll

2001-09-02 Thread Paul Clyne

At 01:09 PM 9/2/01 -0700, you wrote:
>Isn't there some way to control the way that
>information is spewed out (more than a screenfull) in
>Linux? I find the "locate" command so much better than


 Oopsie, my bad

 That should read

 "locate file | more"






Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] manage command-line scroll

2001-09-02 Thread Paul Clyne

At 01:09 PM 9/2/01 -0700, you wrote:
>Isn't there some way to control the way that
>information is spewed out (more than a screenfull) in
>Linux? I find the "locate" command so much better than

 ls | more




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [newbie] manage command-line scroll

2001-09-02 Thread David E. Fox

> Isn't there some way to control the way that
> information is spewed out (more than a screenfull) in

Most progs that send stuff to stdout (i.e., your screen) can be
piped to 'more'. So, in this situation, you'd do 'locate  | more'
and read the output one page at a time.

> command line itself. I'm thinking of something like
> DOS's /w and /p.

IIRC, those switches were only in one program (DIR). Piping to 'more' is
a (erm) more general solution. Also, if you have a 'regular' console, ctrl-s
and ctrl-q should work. For xterms, if you start them up so that they have
a sufficient scroll back buffer (xterm -sb some number) then you can use
the scrollbar.

> Pete R.

David E. Fox  Thanks for letting me
[EMAIL PROTECTED]change magnetic patterns
[EMAIL PROTECTED]   on your hard disk.
---



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



[newbie] manage command-line scroll

2001-09-02 Thread Peter Rymshaw

Isn't there some way to control the way that
information is spewed out (more than a screenfull) in
Linux? I find the "locate" command so much better than
doing "Find" with KDE. but I don't know how to stop it
from scrolling off the page before I can read it. 

I know that there are things like "less" for text
files, but don't know of anything that works on the
command line itself. I'm thinking of something like
DOS's /w and /p.

Thanks anyone.

Pete R.



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com