How can one copy the entire contents of a Linux Terminal / “man” pages to a a text editor (gedit in this...
up vote
0
down vote
favorite
Before I start - I am a 69-year-old Linux newbee - take it easy on me!
Is there an easy way to copy the entire contents of a Terminal (many pages) - "man pages", which I am told are not the same as Terminal pages but look the same to newbee me - see comment below - so that I can transfer it to a text editor? Presently I have to highlight and copy one page at a time, which is rather laborious.
I have seen the explanations of how to copy only a section of the contents of a many-paged Terminal - and this is a little tricky for me - - - I was hoping there was a quick and easy way to do the entire contents?
Thank you for your patience.
command-line copy
add a comment |
up vote
0
down vote
favorite
Before I start - I am a 69-year-old Linux newbee - take it easy on me!
Is there an easy way to copy the entire contents of a Terminal (many pages) - "man pages", which I am told are not the same as Terminal pages but look the same to newbee me - see comment below - so that I can transfer it to a text editor? Presently I have to highlight and copy one page at a time, which is rather laborious.
I have seen the explanations of how to copy only a section of the contents of a many-paged Terminal - and this is a little tricky for me - - - I was hoping there was a quick and easy way to do the entire contents?
Thank you for your patience.
command-line copy
2
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm usingxfce4-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 at 12:38
2
You can do something similar all in one command. From a terminal window type inman find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Before I start - I am a 69-year-old Linux newbee - take it easy on me!
Is there an easy way to copy the entire contents of a Terminal (many pages) - "man pages", which I am told are not the same as Terminal pages but look the same to newbee me - see comment below - so that I can transfer it to a text editor? Presently I have to highlight and copy one page at a time, which is rather laborious.
I have seen the explanations of how to copy only a section of the contents of a many-paged Terminal - and this is a little tricky for me - - - I was hoping there was a quick and easy way to do the entire contents?
Thank you for your patience.
command-line copy
Before I start - I am a 69-year-old Linux newbee - take it easy on me!
Is there an easy way to copy the entire contents of a Terminal (many pages) - "man pages", which I am told are not the same as Terminal pages but look the same to newbee me - see comment below - so that I can transfer it to a text editor? Presently I have to highlight and copy one page at a time, which is rather laborious.
I have seen the explanations of how to copy only a section of the contents of a many-paged Terminal - and this is a little tricky for me - - - I was hoping there was a quick and easy way to do the entire contents?
Thank you for your patience.
command-line copy
command-line copy
edited Nov 15 at 20:06
asked Nov 14 at 12:27
Duncan
1112312
1112312
2
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm usingxfce4-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 at 12:38
2
You can do something similar all in one command. From a terminal window type inman find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54
add a comment |
2
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm usingxfce4-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 at 12:38
2
You can do something similar all in one command. From a terminal window type inman find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54
2
2
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm using
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 install xfce4-terminal
but there may be better...– guiverc
Nov 14 at 12:38
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm using
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 install xfce4-terminal
but there may be better...– guiverc
Nov 14 at 12:38
2
2
You can do something similar all in one command. From a terminal window type in
man find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
You can do something similar all in one command. From a terminal window type in
man find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54
add a comment |
5 Answers
5
active
oldest
votes
up vote
2
down vote
accepted
Two options that don't require selecting, copying and pasting text are:
save output from a single command to a file: this question has several useful answers covering different ways you can pipe command output to a file. Such as: command 2>&1 | tee ~/outputfile.txt
which will write both standard and error output to outputfile.txt
(refer to above link for other variations).
or
save a whole session to a log with: script logfile
(as mentioned here). everything that follows will be logged to "logfile
"
then type exit
when your done to stop logging.
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
add a comment |
up vote
4
down vote
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
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use theman
command to pre-process the file and save that to a plain text file that you can open/edit e.g.man find > manfind.txt
thenvi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?
– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
|
show 1 more comment
up vote
1
down vote
If you want many pages but not all
You can right click at the bottom of the terminal window and drag your mouse up to the window title bar.
The text will scroll as it is highlighted. After appropriate number of pages are highlighted, press the mouse's right button. A context sensitive menu appears where you can select copy
.
Move cursor to your editor and right-click again. Now select paste
.
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
add a comment |
up vote
1
down vote
I have found the easiest ways to address my problem:
1. The "script" command works: It makes a copy of what is in the terminal / man pages and formats it in a way which can be printed from a text file.
2. just add " >> tempfile.log" at the end of every command - one can then edit it later as you want in libreoffice
add a comment |
up vote
0
down vote
I use Ubuntu 16. I am trying to learn Linux and the use of the Terminal. I was wanting to know how to find files. I was directed to "man find" to find the information of how to use the "find" function in the Terminal. So, I went to the Terminal, typed "man find" which took me to those particular pages of the manual - many pages long. I wanted to copy all of that text and transfer it elsewhere (to a text file editor) but did not know how to copy all the text at once - I could only copy one page at a time from the Terminal pages.
SOLUTION: One does not need to use the Terminal at all - one just goes to the text editor and "man find" within that - and here one can copy all the text easily. Hope this helps some other newbee!
2
Or you can send the man page to a file:man find > temp.txt
will save the manual in file temp.txt in your current directory.
– Jean-Marie
Nov 14 at 13:15
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (usingless
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Melebius
Nov 15 at 14:35
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Two options that don't require selecting, copying and pasting text are:
save output from a single command to a file: this question has several useful answers covering different ways you can pipe command output to a file. Such as: command 2>&1 | tee ~/outputfile.txt
which will write both standard and error output to outputfile.txt
(refer to above link for other variations).
or
save a whole session to a log with: script logfile
(as mentioned here). everything that follows will be logged to "logfile
"
then type exit
when your done to stop logging.
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
add a comment |
up vote
2
down vote
accepted
Two options that don't require selecting, copying and pasting text are:
save output from a single command to a file: this question has several useful answers covering different ways you can pipe command output to a file. Such as: command 2>&1 | tee ~/outputfile.txt
which will write both standard and error output to outputfile.txt
(refer to above link for other variations).
or
save a whole session to a log with: script logfile
(as mentioned here). everything that follows will be logged to "logfile
"
then type exit
when your done to stop logging.
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Two options that don't require selecting, copying and pasting text are:
save output from a single command to a file: this question has several useful answers covering different ways you can pipe command output to a file. Such as: command 2>&1 | tee ~/outputfile.txt
which will write both standard and error output to outputfile.txt
(refer to above link for other variations).
or
save a whole session to a log with: script logfile
(as mentioned here). everything that follows will be logged to "logfile
"
then type exit
when your done to stop logging.
Two options that don't require selecting, copying and pasting text are:
save output from a single command to a file: this question has several useful answers covering different ways you can pipe command output to a file. Such as: command 2>&1 | tee ~/outputfile.txt
which will write both standard and error output to outputfile.txt
(refer to above link for other variations).
or
save a whole session to a log with: script logfile
(as mentioned here). everything that follows will be logged to "logfile
"
then type exit
when your done to stop logging.
answered Nov 14 at 14:33
starbuck
16317
16317
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
add a comment |
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
1
1
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Many thanks - your time is much appreciated.
– Duncan
Nov 15 at 20:05
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Happy to help and share my experience, because I would have been lost on many things If not for the help of others. If one of these answers was what you were looking for, don't forget to choose it as the one that solved your problem so others that come across your question know what solution worked for you.
– starbuck
Nov 16 at 2:57
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
Thank you - much appreciated!
– Duncan
Nov 17 at 13:03
add a comment |
up vote
4
down vote
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
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use theman
command to pre-process the file and save that to a plain text file that you can open/edit e.g.man find > manfind.txt
thenvi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?
– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
|
show 1 more comment
up vote
4
down vote
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
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use theman
command to pre-process the file and save that to a plain text file that you can open/edit e.g.man find > manfind.txt
thenvi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?
– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
|
show 1 more comment
up vote
4
down vote
up vote
4
down vote
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
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
edited Nov 14 at 21:00
answered Nov 14 at 12:35
Byte Commander
61.9k26166278
61.9k26166278
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use theman
command to pre-process the file and save that to a plain text file that you can open/edit e.g.man find > manfind.txt
thenvi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?
– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
|
show 1 more comment
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use theman
command to pre-process the file and save that to a plain text file that you can open/edit e.g.man find > manfind.txt
thenvi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?
– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
Many thanks for your comment. However, it seems my question was not clear - best I describe in point form so you understand the problem: 1. Using a Termnial in Ubuntu, I opened the "man find" page - which is many pages long. I would like to copy this, in its entirety, to transfer elsewhere (e.g. to a text editor). I hope this describes my problem better - sorry for the lack of clarity but, being a newbee, I have difficulty with terminology. Thank you for your patience!
– Duncan
Nov 14 at 12:40
duplicate erased
– Duncan
Nov 14 at 12:41
duplicate erased
– Duncan
Nov 14 at 12:41
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
Oh - I see - I don't have to open the terminal at all - I can just open the text editor to find the "man find" file and take it from there. Sorry, I did not realise this - see what a newbee I am! Thanks for your patience!
– Duncan
Nov 14 at 12:54
@Duncan while you can open man page files (for example,
/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use the man
command to pre-process the file and save that to a plain text file that you can open/edit e.g. man find > manfind.txt
then vi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?– steeldriver
Nov 14 at 13:33
@Duncan while you can open man page files (for example,
/usr/share/man/man1/find.1.gz
) they are compressed files with embedded markup - probably not something you will find useful as-is. If you really want to use a text editor, then you will probably want to use the man
command to pre-process the file and save that to a plain text file that you can open/edit e.g. man find > manfind.txt
then vi manfind.txt
. Alternatively you may want to check out Graphical user interface to view man page?– steeldriver
Nov 14 at 13:33
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
I updated my answer @Duncan
– Byte Commander
Nov 14 at 13:49
|
show 1 more comment
up vote
1
down vote
If you want many pages but not all
You can right click at the bottom of the terminal window and drag your mouse up to the window title bar.
The text will scroll as it is highlighted. After appropriate number of pages are highlighted, press the mouse's right button. A context sensitive menu appears where you can select copy
.
Move cursor to your editor and right-click again. Now select paste
.
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
add a comment |
up vote
1
down vote
If you want many pages but not all
You can right click at the bottom of the terminal window and drag your mouse up to the window title bar.
The text will scroll as it is highlighted. After appropriate number of pages are highlighted, press the mouse's right button. A context sensitive menu appears where you can select copy
.
Move cursor to your editor and right-click again. Now select paste
.
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
add a comment |
up vote
1
down vote
up vote
1
down vote
If you want many pages but not all
You can right click at the bottom of the terminal window and drag your mouse up to the window title bar.
The text will scroll as it is highlighted. After appropriate number of pages are highlighted, press the mouse's right button. A context sensitive menu appears where you can select copy
.
Move cursor to your editor and right-click again. Now select paste
.
If you want many pages but not all
You can right click at the bottom of the terminal window and drag your mouse up to the window title bar.
The text will scroll as it is highlighted. After appropriate number of pages are highlighted, press the mouse's right button. A context sensitive menu appears where you can select copy
.
Move cursor to your editor and right-click again. Now select paste
.
answered Nov 14 at 12:47
WinEunuuchs2Unix
39.3k1064146
39.3k1064146
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
add a comment |
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
Thank you - much appreciated.
– Duncan
Nov 15 at 20:06
add a comment |
up vote
1
down vote
I have found the easiest ways to address my problem:
1. The "script" command works: It makes a copy of what is in the terminal / man pages and formats it in a way which can be printed from a text file.
2. just add " >> tempfile.log" at the end of every command - one can then edit it later as you want in libreoffice
add a comment |
up vote
1
down vote
I have found the easiest ways to address my problem:
1. The "script" command works: It makes a copy of what is in the terminal / man pages and formats it in a way which can be printed from a text file.
2. just add " >> tempfile.log" at the end of every command - one can then edit it later as you want in libreoffice
add a comment |
up vote
1
down vote
up vote
1
down vote
I have found the easiest ways to address my problem:
1. The "script" command works: It makes a copy of what is in the terminal / man pages and formats it in a way which can be printed from a text file.
2. just add " >> tempfile.log" at the end of every command - one can then edit it later as you want in libreoffice
I have found the easiest ways to address my problem:
1. The "script" command works: It makes a copy of what is in the terminal / man pages and formats it in a way which can be printed from a text file.
2. just add " >> tempfile.log" at the end of every command - one can then edit it later as you want in libreoffice
answered Nov 15 at 20:02
Duncan
1112312
1112312
add a comment |
add a comment |
up vote
0
down vote
I use Ubuntu 16. I am trying to learn Linux and the use of the Terminal. I was wanting to know how to find files. I was directed to "man find" to find the information of how to use the "find" function in the Terminal. So, I went to the Terminal, typed "man find" which took me to those particular pages of the manual - many pages long. I wanted to copy all of that text and transfer it elsewhere (to a text file editor) but did not know how to copy all the text at once - I could only copy one page at a time from the Terminal pages.
SOLUTION: One does not need to use the Terminal at all - one just goes to the text editor and "man find" within that - and here one can copy all the text easily. Hope this helps some other newbee!
2
Or you can send the man page to a file:man find > temp.txt
will save the manual in file temp.txt in your current directory.
– Jean-Marie
Nov 14 at 13:15
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (usingless
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Melebius
Nov 15 at 14:35
add a comment |
up vote
0
down vote
I use Ubuntu 16. I am trying to learn Linux and the use of the Terminal. I was wanting to know how to find files. I was directed to "man find" to find the information of how to use the "find" function in the Terminal. So, I went to the Terminal, typed "man find" which took me to those particular pages of the manual - many pages long. I wanted to copy all of that text and transfer it elsewhere (to a text file editor) but did not know how to copy all the text at once - I could only copy one page at a time from the Terminal pages.
SOLUTION: One does not need to use the Terminal at all - one just goes to the text editor and "man find" within that - and here one can copy all the text easily. Hope this helps some other newbee!
2
Or you can send the man page to a file:man find > temp.txt
will save the manual in file temp.txt in your current directory.
– Jean-Marie
Nov 14 at 13:15
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (usingless
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Melebius
Nov 15 at 14:35
add a comment |
up vote
0
down vote
up vote
0
down vote
I use Ubuntu 16. I am trying to learn Linux and the use of the Terminal. I was wanting to know how to find files. I was directed to "man find" to find the information of how to use the "find" function in the Terminal. So, I went to the Terminal, typed "man find" which took me to those particular pages of the manual - many pages long. I wanted to copy all of that text and transfer it elsewhere (to a text file editor) but did not know how to copy all the text at once - I could only copy one page at a time from the Terminal pages.
SOLUTION: One does not need to use the Terminal at all - one just goes to the text editor and "man find" within that - and here one can copy all the text easily. Hope this helps some other newbee!
I use Ubuntu 16. I am trying to learn Linux and the use of the Terminal. I was wanting to know how to find files. I was directed to "man find" to find the information of how to use the "find" function in the Terminal. So, I went to the Terminal, typed "man find" which took me to those particular pages of the manual - many pages long. I wanted to copy all of that text and transfer it elsewhere (to a text file editor) but did not know how to copy all the text at once - I could only copy one page at a time from the Terminal pages.
SOLUTION: One does not need to use the Terminal at all - one just goes to the text editor and "man find" within that - and here one can copy all the text easily. Hope this helps some other newbee!
answered Nov 14 at 12:59
Duncan
1112312
1112312
2
Or you can send the man page to a file:man find > temp.txt
will save the manual in file temp.txt in your current directory.
– Jean-Marie
Nov 14 at 13:15
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (usingless
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Melebius
Nov 15 at 14:35
add a comment |
2
Or you can send the man page to a file:man find > temp.txt
will save the manual in file temp.txt in your current directory.
– Jean-Marie
Nov 14 at 13:15
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (usingless
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Melebius
Nov 15 at 14:35
2
2
Or you can send the man page to a file:
man find > temp.txt
will save the manual in file temp.txt in your current directory.– Jean-Marie
Nov 14 at 13:15
Or you can send the man page to a file:
man find > temp.txt
will save the manual in file temp.txt in your current directory.– Jean-Marie
Nov 14 at 13:15
1
1
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
manual pages are available to view in a web browser as well! check out linux.die.net/man or just do a search for "man somecommand"
– starbuck
Nov 14 at 14:42
2
2
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using
less
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.– Melebius
Nov 15 at 14:35
This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using
less
as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.– Melebius
Nov 15 at 14:35
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092845%2fhow-can-one-copy-the-entire-contents-of-a-linux-terminal-man-pages-to-a-a-te%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You haven't told us what Ubuntu you are using, and what DE (which could be GNOME or Unity, or different if it's a Ubuntu flavor such as Xubuntu) which is useful. As I'm running Xubuntu, I'm using
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 at 12:38
2
You can do something similar all in one command. From a terminal window type in
man find > /tmp/temp.txt && gedit /tmp/temp.txt 2>/dev/null
– Terrance
Nov 14 at 14:16
The following comment has been made - I don't really understand it but the writer seems to know what he is talking about and has asked me to include it here - so, here goes: This looks unrelated to the original question. Is your real intention to save man pages? Then please edit your question or create a new one since man pages are quite different from what you wrote earlier. They are not printed to the terminal altogether by default (using less as the pager) and the ways suggested by others to copy the terminal contents won’t work for them.
– Duncan
Nov 15 at 19:54