Is it possible to change tail's default line count?

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











up vote
0
down vote

favorite












When I use tail file, tail by default prints the last 10 lines.



Is it possible to change that default in the system level?










share|improve this question

























    up vote
    0
    down vote

    favorite












    When I use tail file, tail by default prints the last 10 lines.



    Is it possible to change that default in the system level?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      When I use tail file, tail by default prints the last 10 lines.



      Is it possible to change that default in the system level?










      share|improve this question













      When I use tail file, tail by default prints the last 10 lines.



      Is it possible to change that default in the system level?







      linux tail






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 3 '17 at 9:40









      Itai Ganot

      3161412




      3161412




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          No, but you can use alias.



          Add to your .bashrc this string:



          alias tails='tail -n 15'


          relogin at the server and try to type:



          tails file


          And you will get the last 15 lines of file






          share|improve this answer



























            up vote
            4
            down vote













            No, the default number of lines produced by tail (and head) is mandated by the POSIX standard:




            If neither -c nor -n is specified, -n 10 shall be assumed.




            To get a different number of lines, use the -n command line option, or create a shell function:



            mytail () tail -n 5 "$@"; 


            or, if you're brave enough,



            tail () command tail -n 5 "$@"; 





            share|improve this answer



























              up vote
              0
              down vote













              To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use



              tail -n 42


              to output the last 42 lines.






              share|improve this answer




















              • Yea, I know this one... thanks anyways
                – Itai Ganot
                Oct 3 '17 at 9:45










              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%2f395795%2fis-it-possible-to-change-tails-default-line-count%23new-answer', 'question_page');

              );

              Post as a guest






























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote



              accepted










              No, but you can use alias.



              Add to your .bashrc this string:



              alias tails='tail -n 15'


              relogin at the server and try to type:



              tails file


              And you will get the last 15 lines of file






              share|improve this answer
























                up vote
                1
                down vote



                accepted










                No, but you can use alias.



                Add to your .bashrc this string:



                alias tails='tail -n 15'


                relogin at the server and try to type:



                tails file


                And you will get the last 15 lines of file






                share|improve this answer






















                  up vote
                  1
                  down vote



                  accepted







                  up vote
                  1
                  down vote



                  accepted






                  No, but you can use alias.



                  Add to your .bashrc this string:



                  alias tails='tail -n 15'


                  relogin at the server and try to type:



                  tails file


                  And you will get the last 15 lines of file






                  share|improve this answer












                  No, but you can use alias.



                  Add to your .bashrc this string:



                  alias tails='tail -n 15'


                  relogin at the server and try to type:



                  tails file


                  And you will get the last 15 lines of file







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 3 '17 at 10:02









                  Egor Vasilyev

                  1,792129




                  1,792129






















                      up vote
                      4
                      down vote













                      No, the default number of lines produced by tail (and head) is mandated by the POSIX standard:




                      If neither -c nor -n is specified, -n 10 shall be assumed.




                      To get a different number of lines, use the -n command line option, or create a shell function:



                      mytail () tail -n 5 "$@"; 


                      or, if you're brave enough,



                      tail () command tail -n 5 "$@"; 





                      share|improve this answer
























                        up vote
                        4
                        down vote













                        No, the default number of lines produced by tail (and head) is mandated by the POSIX standard:




                        If neither -c nor -n is specified, -n 10 shall be assumed.




                        To get a different number of lines, use the -n command line option, or create a shell function:



                        mytail () tail -n 5 "$@"; 


                        or, if you're brave enough,



                        tail () command tail -n 5 "$@"; 





                        share|improve this answer






















                          up vote
                          4
                          down vote










                          up vote
                          4
                          down vote









                          No, the default number of lines produced by tail (and head) is mandated by the POSIX standard:




                          If neither -c nor -n is specified, -n 10 shall be assumed.




                          To get a different number of lines, use the -n command line option, or create a shell function:



                          mytail () tail -n 5 "$@"; 


                          or, if you're brave enough,



                          tail () command tail -n 5 "$@"; 





                          share|improve this answer












                          No, the default number of lines produced by tail (and head) is mandated by the POSIX standard:




                          If neither -c nor -n is specified, -n 10 shall be assumed.




                          To get a different number of lines, use the -n command line option, or create a shell function:



                          mytail () tail -n 5 "$@"; 


                          or, if you're brave enough,



                          tail () command tail -n 5 "$@"; 






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Oct 3 '17 at 9:57









                          Kusalananda

                          105k14209326




                          105k14209326




















                              up vote
                              0
                              down vote













                              To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use



                              tail -n 42


                              to output the last 42 lines.






                              share|improve this answer




















                              • Yea, I know this one... thanks anyways
                                – Itai Ganot
                                Oct 3 '17 at 9:45














                              up vote
                              0
                              down vote













                              To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use



                              tail -n 42


                              to output the last 42 lines.






                              share|improve this answer




















                              • Yea, I know this one... thanks anyways
                                – Itai Ganot
                                Oct 3 '17 at 9:45












                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use



                              tail -n 42


                              to output the last 42 lines.






                              share|improve this answer












                              To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use



                              tail -n 42


                              to output the last 42 lines.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Oct 3 '17 at 9:45









                              dr01

                              15.4k114769




                              15.4k114769











                              • Yea, I know this one... thanks anyways
                                – Itai Ganot
                                Oct 3 '17 at 9:45
















                              • Yea, I know this one... thanks anyways
                                – Itai Ganot
                                Oct 3 '17 at 9:45















                              Yea, I know this one... thanks anyways
                              – Itai Ganot
                              Oct 3 '17 at 9:45




                              Yea, I know this one... thanks anyways
                              – Itai Ganot
                              Oct 3 '17 at 9:45

















                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395795%2fis-it-possible-to-change-tails-default-line-count%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?