[Tutor] Scrolling through output in shell

Shawn Milochik Shawn at milochik.com
Mon Nov 17 15:20:55 CET 2008


On Sun, Nov 16, 2008 at 1:21 PM, Mike Hoy <mhoy06 at gmail.com> wrote:
> I'm writing a small program that writes to a text file. I want to be
> able to view the contents of the text file inside of shell. But the
> file is too large for a small shell window. Is there a way for the
> user to 'scroll' through the contents of file that has been read into
> the program? I noticed that on the man pages that you can do that
> although I'm sure it's not written in python. Do I need to find a new
> language to write this in? Maybe use a different language for the
> output and still use python? Any help appreciated.
>
> --
> Mike Hoy
> http://www.mikehoy.net



As Alan has noted, your request isn't perfectly clear. So, I'm going
to change your question and answer it. If I picked the wrong question,
please be more explicit in your next reply.

Question: How can I read a text file from the command line if the file
is too large to fit on the screen at once?

Answer: more or less
If you're in Windows, you can use the more command: more file.txt
That will allow you to scroll up and down.

If you're on pretty much any other OS, you can use more or less. I
prefer less, because it has more features. You use it the same way you
use more:  less file.txt


More information about the Tutor mailing list