The default terminal emulator on Ubuntu, gnome-terminal
should have a "Select all" option in its "Edit" menu.
Once everything is selected, you can copy it with Ctrl+Shift+C, or right-click and selecting "Copy", or "Copy" from the "Edit" menu.
Note however that the terminal buffer is limited by default to a few thousand lines. If your session accumulates more lines, those will be truncated and you only get the most recent part. If you need more, you can change the size of the scrollback buffer in the menu "Edit" > "Profile preferences" > "Scrolling" > "Limit scrollback to ___".
Update based on your clarification in comments:
man
uses a pager (should be less
by default) which uses a different terminal mode to provide scrollable text on a single screen, instead of relying on the terminal emulator to let you scroll through the backlog.
To get the whole content of a man
page in your terminal at once, so that you can select and copy it all, you can tell it to not use any pager by adding the argument --pager=
, like:
man --pager= find
If you want this behaviour to be the default, you can append the line below to your ~/.bashrc
file:
export MANPAGER=""
Alternatively, the pages is also disabled if you pipe the output through any other command, like e.g. cat
, which just reproduces it as it is:
man find | cat
Or if your actual goal is to save the manual to a text file, you can redirect the command output to a file directly:
man find > find.txt
xfce4-terminal
, and I can edit ALT E (or click the EDIT menu) and then SELECT ALL and all text in the terminal is selected. I could then select COPY, or COPY AT HTML, or I'd just hit CTRL-INS to copy it to my buffer, and then paste into my text editor. This would work in all Xubuntu's (i'm using 19.04 but that doesn't matter). You could always installxfce4-terminal
but there may be better... – guiverc Nov 14 '18 at 12:38man find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance Nov 14 '18 at 14:16