I know it’s probably a simple answer, but how do I output to the printer.
e.g. If I wanted to print the commands that are used in terminal (manual).
How do I do it?
OK, the terminal by default usually “prints” to screen … but you CAN redirect the output to a text file, then print that … as in:
man lp >> ~/lp_manual.txt
which will save the output from man lp to a text file in your Home directory called lp_manual.txt
or directly to the printer by piping the output through lp … as in:
man firefox | lp -d printername
See the lp manpage:
man lp
Be aware, in the first command (redirect to a text fie) …
>> = (if exists) append to the end of the output file.
but if you use a single >
> = (if exists) overwrite the contents of the output file.
So if you did:
man ls >> ~/myoutput.txt
then
cat /proc/cpuinfo >> ~/myoutput.txt
the output of the cat command would be ADDED to the end of output from the man command in ~/myoutput.txt
whereas if you used a single “>” it would OVERWRITE the output from the first man command in ~/myoutput.txt
How about;
script
<do you stuff here>
CTRL+D
You should now have a record of your commands and their output (or whatever you did in in the file it tells you it’s going to use, typically a file called “typescript”.
Nice … that’s going to be handy