In terminal a command has a too long output. But when I scroll back I see it is truncated and only the last part is shown. In Gnome-Terminal and Konsole I have this problem. In xterm there's not such problem but I cannot copy the output in xterm.
How can I get the complete output?
You could send the output to a file:
command > file.txt
(wherecommand
is the command you want to run andfile.txt
is the file you want to save it to) and then view it withgedit file.txt
.Use xclip
If not installed you can do
I know in the xfce4-terminal there is a option to increase the number of lines shown:
For ubuntu
Terminal
Aside from that there is what @Zelda64fan said.
If you don't need the entire output, you could pipe it through less:
command | less
. This would also save the bother of having to delete the file once you've reviewed the output.In xterm, autocopy on select should be the default. Try triple-clicking then use a middle mouse button (or emulated third button) to paste.
The same should work with other terminals, but you need to manually copy and paste.
There a many, many ways to do this. I like using
script
in some cases. Type 'script' from a command line to start it before you launch a command from the command line, then hit Ctrl-D to stop. If you don't specify a capture filename, 'typescript' is the default. Everything printed to the screen should be captured in the file.Save console output into a file:
tee
commandtee command - read from standard input and write to standard output and files.
It automatically creates file and save, all the output of cmd
ps -ax
into a file named asprocesses_info
in the same folder from where the cmd has run.script
commandscript command - make typescript of terminal session.
This creates a file named as
my_console_output.txt
and will open a subshell and records all information through this session. After this, script get started and whatever the console output, it will get stored in the filemy_console_output.txt
; unless and until the script ends when the forked shell exits. (e.g., when the user typesexit
or when CTRLD is typed.)it starts the script;
creates the file
processes_info.txt
;stores the console output into the file;
end (close) the script.
Other example: