Screen Paging and FTP

ME dugan at libwais.sonoma.edu
Thu Mar 30 19:49:48 PST 2000


My comments near end...

On Thu, 30 Mar 2000, Robert Silvestro wrote:
> -----Original Message-----
> From: owner-nblug-talk at afterburner.sonic.net
> [mailto:owner-nblug-talk at afterburner.sonic.net]On Behalf Of Aldo Cimino
> Sent: Wednesday, March 29, 2000 10:51 PM
> To: NBLUG Discussion List
> Subject: Screen Paging and FTP
> 
> 
> Using the standard ftp program, is there a way to page the screen?  For
> instance, if I'm listing a _huge_ directory, is there a command which
> provides an equivalent function to less or more, since neither of which
> seem to function in ftp?
> 
> I've checked the ftp man page, as well as Linux in a Nutshell.  If the
> answer is in either of these sources, it has escaped me.
> 
> 
> ls . |more Will give you one page at a time in FTP.

Since most others have commented upon the |less and |more technique for
reviewing pages, I thought that I could include a few others that may be
useful:

1) If you are in an X-term session you may have a scroll bar from which to
scroll up. If you do not have a scroll bar, then check the man pages for

2) if you are on the console and have listed a directory or something
which scrolls off the top of the page, try holding down the (SHIFT) key
and pressing the (PAGE UP) key. Granted the scroll region offered within
this is small, *and* you lose the scroll region for the TTY when you
ALT-Fn to another one (in most systems anyway) this is something to try
and see if it works for you.

3) A very useful tool and utility for starting things, disconnecting, and
reconnecting elsewhere where you left off is called "screen"
It allows you to start multiple ptty sessions from a single shell login.

You should check the man pages on it, but a brief review:
screen-command-instruction = control-a
control-a c (new screen/window)
control-a k (kill present screen/window)
control-a [0-9] (Where [0-9] implies a single number from 0 to 9: jump two
  that window. "control-a 0" would jump to window/screen 0, "control-a 1"
  would jump to window/screen 1.)
control-a d (detach screen to logout.)
screen -r (from command line allows you to reconnect to a screen session
  previously detached.)

Those are the basic keystrokes. Check the man page for more.

Relevant to the question asked:
control-a (ESC) then allows you to go to copy/paste mode. You can use the
"vi" keys (h,j,k, and l) to move (left,down,up, and right.) and scroll
back into the screen buffer if you scroll up beyond the top of the
displayed text. Then you can press (SPACE) to start copying from where you
have left the cursor, use the "vi" keys to move around and highlight text
you want to copy, then press space again to copy that text into the screen
copy-space.
This then jumps you back to the bottom of the session with your shell
prompt.
control-a ] (To paste that screen copy-space while in screen, I think you
   type)

If you find you need to use a control-a while in screen (like in bash to
jump to the beginning of the present line, or in emacs to jump to the
beginning of the present line, or while in minicom in screen) you must:
control-a a

The maximum buffer size in screen can be increased as a command line
option like "-h line-number-to-buffer-go-here" I think.

These 3 are offered as alternatives. I prefer teaching the |more method
since is seems to be more consistently available in more unix and
unix-like systems.

Enjoy,
-ME





More information about the talk mailing list