journalctl: how to prevent text from truncating in terminal

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
35
down vote

favorite
8












How can I keep long strings from truncating in terminal? For example if I run



journalctl -xn



There's a lot of text that I cannot read. I am open to using other programs/tools.










share|improve this question























  • Use journalctl -x, -n default to 10 lines in log only.
    – cuonglm
    Sep 12 '15 at 2:24














up vote
35
down vote

favorite
8












How can I keep long strings from truncating in terminal? For example if I run



journalctl -xn



There's a lot of text that I cannot read. I am open to using other programs/tools.










share|improve this question























  • Use journalctl -x, -n default to 10 lines in log only.
    – cuonglm
    Sep 12 '15 at 2:24












up vote
35
down vote

favorite
8









up vote
35
down vote

favorite
8






8





How can I keep long strings from truncating in terminal? For example if I run



journalctl -xn



There's a lot of text that I cannot read. I am open to using other programs/tools.










share|improve this question















How can I keep long strings from truncating in terminal? For example if I run



journalctl -xn



There's a lot of text that I cannot read. I am open to using other programs/tools.







terminal systemd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 12 '15 at 13:26









don_crissti

47.4k15126155




47.4k15126155










asked Sep 12 '15 at 2:18









P.Brian.Mackey

3912512




3912512











  • Use journalctl -x, -n default to 10 lines in log only.
    – cuonglm
    Sep 12 '15 at 2:24
















  • Use journalctl -x, -n default to 10 lines in log only.
    – cuonglm
    Sep 12 '15 at 2:24















Use journalctl -x, -n default to 10 lines in log only.
– cuonglm
Sep 12 '15 at 2:24




Use journalctl -x, -n default to 10 lines in log only.
– cuonglm
Sep 12 '15 at 2:24










4 Answers
4






active

oldest

votes

















up vote
30
down vote



accepted










From the journalctl manpage:



 The output is paged through less by default, and long lines are
"truncated" to screen width. The hidden part can be viewed by using the
left-arrow and right-arrow keys. Paging can be disabled; see the
--no-pager option and the "Environment" section below.


If you don't want to constantly be using the left and right arrow keys, simply pipe it directly to less:



$ journalctl -xn | less


This will wrap lines that are too long for your terminal (the default behavior of less, which journalctl overrides).



Or, of course, if you don't mind possibly having to use your terminal's scrollback, you could use no pager at all:



$ journalctl -xn --no-pager





share|improve this answer






















  • Ah, yes. I saw.
    – cuonglm
    Sep 12 '15 at 11:56

















up vote
13
down vote













I also do:



journalctl -xn | less


But you can also set the SYSTEMD_LESS environment variable:



SYSTEMD_LESS=FRXMK journalctl -xn
# Or even
# SYSTEMD_LESS="" journalctl -xn
# The environment variable needs to be there, but can be the empty string


I got that from: [systemd-devel] [PATCH] pager: wrap long lines by default



Set it in your .bashrc and be done with it! :-)



That systemd needs to setup less specially and doesn't just honor the less defaults and the LESS environment seems a little arrogant to me, but hey, this works...






share|improve this answer




















  • SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
    – jnas
    Nov 19 '15 at 9:02










  • Works at least on CentOS 7.5.
    – Vertigo
    Aug 14 at 11:28











  • Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
    – Metamorphic
    Sep 14 at 17:51

















up vote
2
down vote













If the program already uses less (if not, pipe the output to it), you can enable/disable line wrapping by typing -S (in less), This works for other less options as well.






share|improve this answer



























    up vote
    -1
    down vote













    I type in terminal,
    journalctl | more, works great for me then I use arrows up or down.






    share|improve this answer






















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f229188%2fjournalctl-how-to-prevent-text-from-truncating-in-terminal%23new-answer', 'question_page');

      );

      Post as a guest






























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      30
      down vote



      accepted










      From the journalctl manpage:



       The output is paged through less by default, and long lines are
      "truncated" to screen width. The hidden part can be viewed by using the
      left-arrow and right-arrow keys. Paging can be disabled; see the
      --no-pager option and the "Environment" section below.


      If you don't want to constantly be using the left and right arrow keys, simply pipe it directly to less:



      $ journalctl -xn | less


      This will wrap lines that are too long for your terminal (the default behavior of less, which journalctl overrides).



      Or, of course, if you don't mind possibly having to use your terminal's scrollback, you could use no pager at all:



      $ journalctl -xn --no-pager





      share|improve this answer






















      • Ah, yes. I saw.
        – cuonglm
        Sep 12 '15 at 11:56














      up vote
      30
      down vote



      accepted










      From the journalctl manpage:



       The output is paged through less by default, and long lines are
      "truncated" to screen width. The hidden part can be viewed by using the
      left-arrow and right-arrow keys. Paging can be disabled; see the
      --no-pager option and the "Environment" section below.


      If you don't want to constantly be using the left and right arrow keys, simply pipe it directly to less:



      $ journalctl -xn | less


      This will wrap lines that are too long for your terminal (the default behavior of less, which journalctl overrides).



      Or, of course, if you don't mind possibly having to use your terminal's scrollback, you could use no pager at all:



      $ journalctl -xn --no-pager





      share|improve this answer






















      • Ah, yes. I saw.
        – cuonglm
        Sep 12 '15 at 11:56












      up vote
      30
      down vote



      accepted







      up vote
      30
      down vote



      accepted






      From the journalctl manpage:



       The output is paged through less by default, and long lines are
      "truncated" to screen width. The hidden part can be viewed by using the
      left-arrow and right-arrow keys. Paging can be disabled; see the
      --no-pager option and the "Environment" section below.


      If you don't want to constantly be using the left and right arrow keys, simply pipe it directly to less:



      $ journalctl -xn | less


      This will wrap lines that are too long for your terminal (the default behavior of less, which journalctl overrides).



      Or, of course, if you don't mind possibly having to use your terminal's scrollback, you could use no pager at all:



      $ journalctl -xn --no-pager





      share|improve this answer














      From the journalctl manpage:



       The output is paged through less by default, and long lines are
      "truncated" to screen width. The hidden part can be viewed by using the
      left-arrow and right-arrow keys. Paging can be disabled; see the
      --no-pager option and the "Environment" section below.


      If you don't want to constantly be using the left and right arrow keys, simply pipe it directly to less:



      $ journalctl -xn | less


      This will wrap lines that are too long for your terminal (the default behavior of less, which journalctl overrides).



      Or, of course, if you don't mind possibly having to use your terminal's scrollback, you could use no pager at all:



      $ journalctl -xn --no-pager






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Sep 12 '15 at 3:34

























      answered Sep 12 '15 at 3:28









      Doorknob

      1,396816




      1,396816











      • Ah, yes. I saw.
        – cuonglm
        Sep 12 '15 at 11:56
















      • Ah, yes. I saw.
        – cuonglm
        Sep 12 '15 at 11:56















      Ah, yes. I saw.
      – cuonglm
      Sep 12 '15 at 11:56




      Ah, yes. I saw.
      – cuonglm
      Sep 12 '15 at 11:56












      up vote
      13
      down vote













      I also do:



      journalctl -xn | less


      But you can also set the SYSTEMD_LESS environment variable:



      SYSTEMD_LESS=FRXMK journalctl -xn
      # Or even
      # SYSTEMD_LESS="" journalctl -xn
      # The environment variable needs to be there, but can be the empty string


      I got that from: [systemd-devel] [PATCH] pager: wrap long lines by default



      Set it in your .bashrc and be done with it! :-)



      That systemd needs to setup less specially and doesn't just honor the less defaults and the LESS environment seems a little arrogant to me, but hey, this works...






      share|improve this answer




















      • SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
        – jnas
        Nov 19 '15 at 9:02










      • Works at least on CentOS 7.5.
        – Vertigo
        Aug 14 at 11:28











      • Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
        – Metamorphic
        Sep 14 at 17:51














      up vote
      13
      down vote













      I also do:



      journalctl -xn | less


      But you can also set the SYSTEMD_LESS environment variable:



      SYSTEMD_LESS=FRXMK journalctl -xn
      # Or even
      # SYSTEMD_LESS="" journalctl -xn
      # The environment variable needs to be there, but can be the empty string


      I got that from: [systemd-devel] [PATCH] pager: wrap long lines by default



      Set it in your .bashrc and be done with it! :-)



      That systemd needs to setup less specially and doesn't just honor the less defaults and the LESS environment seems a little arrogant to me, but hey, this works...






      share|improve this answer




















      • SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
        – jnas
        Nov 19 '15 at 9:02










      • Works at least on CentOS 7.5.
        – Vertigo
        Aug 14 at 11:28











      • Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
        – Metamorphic
        Sep 14 at 17:51












      up vote
      13
      down vote










      up vote
      13
      down vote









      I also do:



      journalctl -xn | less


      But you can also set the SYSTEMD_LESS environment variable:



      SYSTEMD_LESS=FRXMK journalctl -xn
      # Or even
      # SYSTEMD_LESS="" journalctl -xn
      # The environment variable needs to be there, but can be the empty string


      I got that from: [systemd-devel] [PATCH] pager: wrap long lines by default



      Set it in your .bashrc and be done with it! :-)



      That systemd needs to setup less specially and doesn't just honor the less defaults and the LESS environment seems a little arrogant to me, but hey, this works...






      share|improve this answer












      I also do:



      journalctl -xn | less


      But you can also set the SYSTEMD_LESS environment variable:



      SYSTEMD_LESS=FRXMK journalctl -xn
      # Or even
      # SYSTEMD_LESS="" journalctl -xn
      # The environment variable needs to be there, but can be the empty string


      I got that from: [systemd-devel] [PATCH] pager: wrap long lines by default



      Set it in your .bashrc and be done with it! :-)



      That systemd needs to setup less specially and doesn't just honor the less defaults and the LESS environment seems a little arrogant to me, but hey, this works...







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 9 '15 at 9:17









      Peter V. Mørch

      26515




      26515











      • SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
        – jnas
        Nov 19 '15 at 9:02










      • Works at least on CentOS 7.5.
        – Vertigo
        Aug 14 at 11:28











      • Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
        – Metamorphic
        Sep 14 at 17:51
















      • SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
        – jnas
        Nov 19 '15 at 9:02










      • Works at least on CentOS 7.5.
        – Vertigo
        Aug 14 at 11:28











      • Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
        – Metamorphic
        Sep 14 at 17:51















      SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
      – jnas
      Nov 19 '15 at 9:02




      SYSTEMD_LESS support is only recently added, e.g CentOS 7 does not have a version that supports it
      – jnas
      Nov 19 '15 at 9:02












      Works at least on CentOS 7.5.
      – Vertigo
      Aug 14 at 11:28





      Works at least on CentOS 7.5.
      – Vertigo
      Aug 14 at 11:28













      Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
      – Metamorphic
      Sep 14 at 17:51




      Great solution, I also added Defaults env_keep += "LESS SYSTEMD_LESS" to /etc/sudoers. It's for those times when I accidentally put sudo in front of e.g. systemctl status.
      – Metamorphic
      Sep 14 at 17:51










      up vote
      2
      down vote













      If the program already uses less (if not, pipe the output to it), you can enable/disable line wrapping by typing -S (in less), This works for other less options as well.






      share|improve this answer
























        up vote
        2
        down vote













        If the program already uses less (if not, pipe the output to it), you can enable/disable line wrapping by typing -S (in less), This works for other less options as well.






        share|improve this answer






















          up vote
          2
          down vote










          up vote
          2
          down vote









          If the program already uses less (if not, pipe the output to it), you can enable/disable line wrapping by typing -S (in less), This works for other less options as well.






          share|improve this answer












          If the program already uses less (if not, pipe the output to it), you can enable/disable line wrapping by typing -S (in less), This works for other less options as well.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 12 '15 at 8:22









          Thomas Erker

          1,689715




          1,689715




















              up vote
              -1
              down vote













              I type in terminal,
              journalctl | more, works great for me then I use arrows up or down.






              share|improve this answer


























                up vote
                -1
                down vote













                I type in terminal,
                journalctl | more, works great for me then I use arrows up or down.






                share|improve this answer
























                  up vote
                  -1
                  down vote










                  up vote
                  -1
                  down vote









                  I type in terminal,
                  journalctl | more, works great for me then I use arrows up or down.






                  share|improve this answer














                  I type in terminal,
                  journalctl | more, works great for me then I use arrows up or down.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 8 at 5:25









                  Tejas

                  1,77621837




                  1,77621837










                  answered Sep 8 at 2:01









                  user309707

                  1




                  1



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f229188%2fjournalctl-how-to-prevent-text-from-truncating-in-terminal%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?