Print feature in nano?












0















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?










share|improve this question



























    0















    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?










    share|improve this question

























      0












      0








      0








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 29 '13 at 10:15









      NealNeal

      111




      111






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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.





          share|improve this answer
























          • 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



















          0














          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!






          share|improve this answer


























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          0














          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.





          share|improve this answer
























          • 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
















          0














          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.





          share|improve this answer
























          • 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














          0












          0








          0







          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.





          share|improve this answer













          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.






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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













          0














          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!






          share|improve this answer


























          • 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
















          0














          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!






          share|improve this answer


























          • 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














          0












          0








          0







          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!






          share|improve this answer















          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!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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 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

















          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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

          is 'sed' thread safe

          How to make a Squid Proxy server?