FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-01-2011, 03:59 PM
Jason Hsu
 
Default Command line: How do you keep the output from scrolling out of sight?

I'm using Debian in a command-line-only installation for running a firewall/server.

I know that I'm supposed to use the messages I see every time I enter a command for troubleshooting purposes. But if the output is too long, then the first messages scroll out of sight, and that makes it impossible to properly troubleshoot when I don't know what I'm doing. Is there a way to get the output to temporarily stop so I can read it all if I wish?

--
Jason Hsu <jhsu802701@jasonhsu.com>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110301105932.99d1a32c.jhsu802701@jasonhsu.com">h ttp://lists.debian.org/20110301105932.99d1a32c.jhsu802701@jasonhsu.com
 
Old 03-01-2011, 04:14 PM
Wayne Topa
 
Default Command line: How do you keep the output from scrolling out of sight?

On 03/01/2011 11:59 AM, Jason Hsu wrote:

I'm using Debian in a command-line-only installation for running a firewall/server.

I know that I'm supposed to use the messages I see every time I enter a command for troubleshooting purposes. But if the output is too long, then the first messages scroll out of sight, and that makes it impossible to properly troubleshoot when I don't know what I'm doing. Is there a way to get the output to temporarily stop so I can read it all if I wish?



Have you tries the he 'Scroll Lock' key?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4D6D298C.10103@gmail.com">http://lists.debian.org/4D6D298C.10103@gmail.com
 
Old 03-01-2011, 04:17 PM
"John A. Sullivan III"
 
Default Command line: How do you keep the output from scrolling out of sight?

On Tue, 2011-03-01 at 10:59 -0600, Jason Hsu wrote:
> I'm using Debian in a command-line-only installation for running a firewall/server.
>
> I know that I'm supposed to use the messages I see every time I enter a command for troubleshooting purposes. But if the output is too long, then the first messages scroll out of sight, and that makes it impossible to properly troubleshoot when I don't know what I'm doing. Is there a way to get the output to temporarily stop so I can read it all if I wish?
>
> --
> Jason Hsu <jhsu802701@jasonhsu.com>
>
>
Yes, you can either use <SHIFT><PgUp> and <PgDn> or you can pipe it
through less (or more), e.g., ls /usr/bin | less

Hope that's what you're looking for - John


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1298999832.12172.2.camel@denise.theartistscloset.c om">http://lists.debian.org/1298999832.12172.2.camel@denise.theartistscloset.c om
 
Old 03-01-2011, 04:22 PM
Chris Jackson
 
Default Command line: How do you keep the output from scrolling out of sight?

Jason Hsu wrote:

> I'm using Debian in a command-line-only installation for running a firewall/server.
>
> I know that I'm supposed to use the messages I see every time I enter a command for troubleshooting purposes. But if the output is too long, then the first messages scroll out of sight, and that makes it impossible to properly troubleshoot when I don't know what I'm doing. Is there a way to get the output to temporarily stop so I can read it all if I wish?
>


On most terminals:

CTRL-S will stop output

CTRL-Q will restart it

Note that if it runs out of buffer space the process will stop, blocking
on output.

Also, possibly useful, SHIFT-PgUp may scroll back half a page (but it
drops back to the bottom when there's new output)

Other useful things may be to pipe the output through less (which
presents it one page at a time) or tee (which will save it to a file,
and you can look through the file from another termianal while output
continues on the main one). Check out the man pages for those two things
if they seem useful.

If you're not sure about piping things to other things, you need to read
up on how to use the command line. This site seems as good as any, but a
web search will provide many others:

http://linuxcommand.org/

--
Chris Jackson
Shadowcat Systems Ltd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D6D2B63.70109@shadowcat.co.uk">http://lists.debian.org/4D6D2B63.70109@shadowcat.co.uk
 
Old 03-01-2011, 04:32 PM
"Boyd Stephen Smith Jr."
 
Default Command line: How do you keep the output from scrolling out of sight?

On 2011-03-01 10:59:32 Jason Hsu wrote:
>I know that I'm supposed to use the messages I see every time I enter a
>command for troubleshooting purposes. But if the output is too long, then
>the first messages scroll out of sight, and that makes it impossible to
>properly troubleshoot when I don't know what I'm doing. Is there a way to
>get the output to temporarily stop so I can read it all if I wish?

less / more / pg for interactive viewing.
redirection / tee for persisting output and reviewing both now and later.
script for saving both input and output with the ability to reply the session.

HTH
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
 
Old 03-01-2011, 07:10 PM
"Dr. Ed Morbius"
 
Default Command line: How do you keep the output from scrolling out of sight?

on 10:59 Tue 01 Mar, Jason Hsu (jhsu802701@jasonhsu.com) wrote:
> I'm using Debian in a command-line-only installation for running a
> firewall/server.
>
> I know that I'm supposed to use the messages I see every time I enter
> a command for troubleshooting purposes. But if the output is too
> long, then the first messages scroll out of sight, and that makes it
> impossible to properly troubleshoot when I don't know what I'm doing.
> Is there a way to get the output to temporarily stop so I can read it
> all if I wish?

As others have noted:

command | less

Or an alternate pager, from least to most featured: pg, more, most, dog.
You can specify this with the PAGER environment variable or under
/etc/alternatives/pager (see update-alternatives).

You can dump output to a file. Several varaints:

command >myfile # save standard output
command >myfile 2>&1 # save standard output & standard error
command >myfile 2>myfile.err # separate stdout/stderr
command >/dev/null # discard stdout (stderr displayed to terminal)
command | tee myfile # view output, save stdout to 'myfile'
command 2>&1 | tee myfile # view output, both stdout & stderr to 'myfile'


Your terminal's scrollbar should be generally useful. Set a
sufficiently large scrollback buffer.

Page-up / page-down, may work in some terminals and/or console.

The 'script' command can be used to record interactive sessions.
Depending on the amount of screen-painting going on (ncurses /
full-screen terminal programs such as top, etc.), this may not be too
readable. 'scriptreplay' may make for a saner output.

Using 'screen' one of the benefits is a scrollback buffer. Very handy.


For noninteractive comamnds, where I want to massage the output but
don't know what filters I need to use immediately (or want to see
intermediate results):

command | vim - # read stdout into vim for interactive editing.


I can then annotate or use futher regex substitutions or commands to
clean up / modify data.


Mostly I just pipe output to less or redirect to a file as needed.

--
Dr. Ed Morbius, Chief Scientist / |
Robot Wrangler / Staff Psychologist | When you seek unlimited power
Krell Power Systems Unlimited | Go to Krell!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110301201028.GC5905@altaira.krellpowersys.exo">h ttp://lists.debian.org/20110301201028.GC5905@altaira.krellpowersys.exo
 

Thread Tools




All times are GMT. The time now is 09:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org