Some commands have very large output texts in terminal. Sometimes some lines of texts goes out of the terminal during command execution. How to get that texts?
Update: I mean the terminal that comes with Ubuntu(12.04).
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Also worth mentioning, you can use
tee to send the output both to a file and to STDOUT:
$ ls -al 2>&1 | tee currDir.txt
This will list the files in the current directory, while also writing them to
currDir.txt. Note that the addition of
2>&1 will also allow this to capture anything sent to STDERR.
Even though the pipe solution (with
tee) would be cleaner, you can also have your terminal keep more lines of output in its window (so that you can scroll up to it).
In Ubuntu 12.04, the usual terminal is
gnome-terminal. Open one, and get to the preferences window (Edit > Preferences). In the Scrolling tab, you'll see a scrollback value, which should be set at 512 lines by default. This value represents the number of lines the terminal will keep available for you to scroll up to. You can increase this value, or check the Unlimited box.
Also remember that the more lines you have your terminal keep, the more memory it takes to do so.