Print feature in nano?

Multi tool use
Is there a way to print a document from the nano text editor, i.e. send it to a printer to be physically printed out? I see that vim and emacs have this feature but I like the simplicity of nano. If not, is there a way to print the document with a linux command?
linux nano
add a comment |
Is there a way to print a document from the nano text editor, i.e. send it to a printer to be physically printed out? I see that vim and emacs have this feature but I like the simplicity of nano. If not, is there a way to print the document with a linux command?
linux nano
add a comment |
Is there a way to print a document from the nano text editor, i.e. send it to a printer to be physically printed out? I see that vim and emacs have this feature but I like the simplicity of nano. If not, is there a way to print the document with a linux command?
linux nano
Is there a way to print a document from the nano text editor, i.e. send it to a printer to be physically printed out? I see that vim and emacs have this feature but I like the simplicity of nano. If not, is there a way to print the document with a linux command?
linux nano
linux nano
asked Sep 29 '13 at 10:15
NealNeal
111
111
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I can see no mention of a print command in nano
's manual and it would surprise me to find one. The traditional method of printing in *nix systems is the lpr
command:
$ lpr foo.txt
From man lpr
:
DESCRIPTION
lpr submits files for printing. Files named on the command line are
sent to the named printer (or the default destination if no destination
is specified). If no files are listed on the command-line, lpr reads
the print file from the standard input.
You can also use a slightly more modern equivalent, enscript
:
DESCRIPTION
Enscript converts text files to PostScript or to other output lan‐
guages. Enscript can spool the generated output directly to a speci‐
fied printer or leave it to a file. If no input files are given,
enscript processes the standard input stdin. Enscript can be extended
to handle different output media and it has many options which can be
used to customize the printouts.
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).lpr
will treat its input as text and print it accordingly.
– terdon
Sep 29 '13 at 14:52
add a comment |
I needed to do the same thing. My solution using the command line:
- Type
less filename >> filename.txt.
- Then I typed
lp filename.txt
and it printed!
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on whatlp
does?
– Burgi
Dec 21 '17 at 8:57
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2fsuperuser.com%2fquestions%2f651866%2fprint-feature-in-nano%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I can see no mention of a print command in nano
's manual and it would surprise me to find one. The traditional method of printing in *nix systems is the lpr
command:
$ lpr foo.txt
From man lpr
:
DESCRIPTION
lpr submits files for printing. Files named on the command line are
sent to the named printer (or the default destination if no destination
is specified). If no files are listed on the command-line, lpr reads
the print file from the standard input.
You can also use a slightly more modern equivalent, enscript
:
DESCRIPTION
Enscript converts text files to PostScript or to other output lan‐
guages. Enscript can spool the generated output directly to a speci‐
fied printer or leave it to a file. If no input files are given,
enscript processes the standard input stdin. Enscript can be extended
to handle different output media and it has many options which can be
used to customize the printouts.
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).lpr
will treat its input as text and print it accordingly.
– terdon
Sep 29 '13 at 14:52
add a comment |
I can see no mention of a print command in nano
's manual and it would surprise me to find one. The traditional method of printing in *nix systems is the lpr
command:
$ lpr foo.txt
From man lpr
:
DESCRIPTION
lpr submits files for printing. Files named on the command line are
sent to the named printer (or the default destination if no destination
is specified). If no files are listed on the command-line, lpr reads
the print file from the standard input.
You can also use a slightly more modern equivalent, enscript
:
DESCRIPTION
Enscript converts text files to PostScript or to other output lan‐
guages. Enscript can spool the generated output directly to a speci‐
fied printer or leave it to a file. If no input files are given,
enscript processes the standard input stdin. Enscript can be extended
to handle different output media and it has many options which can be
used to customize the printouts.
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).lpr
will treat its input as text and print it accordingly.
– terdon
Sep 29 '13 at 14:52
add a comment |
I can see no mention of a print command in nano
's manual and it would surprise me to find one. The traditional method of printing in *nix systems is the lpr
command:
$ lpr foo.txt
From man lpr
:
DESCRIPTION
lpr submits files for printing. Files named on the command line are
sent to the named printer (or the default destination if no destination
is specified). If no files are listed on the command-line, lpr reads
the print file from the standard input.
You can also use a slightly more modern equivalent, enscript
:
DESCRIPTION
Enscript converts text files to PostScript or to other output lan‐
guages. Enscript can spool the generated output directly to a speci‐
fied printer or leave it to a file. If no input files are given,
enscript processes the standard input stdin. Enscript can be extended
to handle different output media and it has many options which can be
used to customize the printouts.
I can see no mention of a print command in nano
's manual and it would surprise me to find one. The traditional method of printing in *nix systems is the lpr
command:
$ lpr foo.txt
From man lpr
:
DESCRIPTION
lpr submits files for printing. Files named on the command line are
sent to the named printer (or the default destination if no destination
is specified). If no files are listed on the command-line, lpr reads
the print file from the standard input.
You can also use a slightly more modern equivalent, enscript
:
DESCRIPTION
Enscript converts text files to PostScript or to other output lan‐
guages. Enscript can spool the generated output directly to a speci‐
fied printer or leave it to a file. If no input files are given,
enscript processes the standard input stdin. Enscript can be extended
to handle different output media and it has many options which can be
used to customize the printouts.
answered Sep 29 '13 at 12:47
terdonterdon
41.8k990139
41.8k990139
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).lpr
will treat its input as text and print it accordingly.
– terdon
Sep 29 '13 at 14:52
add a comment |
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).lpr
will treat its input as text and print it accordingly.
– terdon
Sep 29 '13 at 14:52
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
Would this work for files with non .txt extensions? lpr will only print plaintext files but I need to print out source code for files with extensions like .cpp, but the contents are basically plaintext, aren't they? Thanks.
– Neal
Sep 29 '13 at 14:39
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).
lpr
will treat its input as text and print it accordingly.– terdon
Sep 29 '13 at 14:52
@Neal the *nix world does not use extensions not determine file type (some graphical apps do but those are another matter).
lpr
will treat its input as text and print it accordingly.– terdon
Sep 29 '13 at 14:52
add a comment |
I needed to do the same thing. My solution using the command line:
- Type
less filename >> filename.txt.
- Then I typed
lp filename.txt
and it printed!
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on whatlp
does?
– Burgi
Dec 21 '17 at 8:57
add a comment |
I needed to do the same thing. My solution using the command line:
- Type
less filename >> filename.txt.
- Then I typed
lp filename.txt
and it printed!
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on whatlp
does?
– Burgi
Dec 21 '17 at 8:57
add a comment |
I needed to do the same thing. My solution using the command line:
- Type
less filename >> filename.txt.
- Then I typed
lp filename.txt
and it printed!
I needed to do the same thing. My solution using the command line:
- Type
less filename >> filename.txt.
- Then I typed
lp filename.txt
and it printed!
edited Dec 21 '17 at 8:55
Burgi
3,929102644
3,929102644
answered Dec 21 '17 at 5:45


Larry JohnsonLarry Johnson
1
1
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on whatlp
does?
– Burgi
Dec 21 '17 at 8:57
add a comment |
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on whatlp
does?
– Burgi
Dec 21 '17 at 8:57
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on what
lp
does?– Burgi
Dec 21 '17 at 8:57
This command isn't actually using nano like the OP asked for, but it is a neat solution. Could you perhaps go into a little more detail on what
lp
does?– Burgi
Dec 21 '17 at 8:57
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2fsuperuser.com%2fquestions%2f651866%2fprint-feature-in-nano%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
el,ir8m0Gou5pG3YSiyLZUaducHZzm,9BFSWuRh,AdN,bc Kz39b,L8T5d,g XynvA,vHEjI6uehR9OGF,2NNOGPst