Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a command in AIX to view back-end nodes,etc..but they are too many so they don't fit in one page and when I run the command when it finises I can pnly scroll to last page and cannot read the rest of results in previous pages. How can I either print the results of a command to a text file or be able to pause and see the results on other pages?

share|improve this question
up vote 2 down vote accepted

How can I either print the results of a command to a text file

Use the redirection operators > (overwrites) or >> (appends), which are documented in your shell's manual.

mycommand > output.txt

If you also need to redirect stderr, use one of the following, depending on your shell:

mycommand >& output.txt

mycommand > output.txt 2>&1

or be able to pause and see the results on other pages?

Use a pager such as more, less, w3m, or pg.

mycommand | less

mycommand |& less

mycommand 2>&1 | less

less is more convenient, but might not be installed on all systems.

The | pipe operator is also described in your shell's manual.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .