Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.