Reuse the `apt up` part of the `apt update` and `apt upgrade` commands to execute both in sequence in just one line

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











up vote
1
down vote

favorite
1












How to reuse the apt up part of the apt update and apt upgrade commands to execute both commands in sequence in just one line without an alias.



Something like: apt update,grade.










share|improve this question



























    up vote
    1
    down vote

    favorite
    1












    How to reuse the apt up part of the apt update and apt upgrade commands to execute both commands in sequence in just one line without an alias.



    Something like: apt update,grade.










    share|improve this question

























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      How to reuse the apt up part of the apt update and apt upgrade commands to execute both commands in sequence in just one line without an alias.



      Something like: apt update,grade.










      share|improve this question















      How to reuse the apt up part of the apt update and apt upgrade commands to execute both commands in sequence in just one line without an alias.



      Something like: apt update,grade.







      command-line apt bash upgrade updates






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 mins ago









      Melebius

      3,99051736




      3,99051736










      asked 30 mins ago









      e200

      638




      638




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):



          for i in date,grade; do
          apt up$i
          done


          The smart way is to make an alias in ~/.bashrc for these two commands and forget about retyping it ever again:



          alias upgrade=' apt update && apt upgrade'





          share|improve this answer






















          • Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
            – e200
            25 mins ago











          • @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
            – Sergiy Kolodyazhnyy
            21 mins ago






          • 2




            Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
            – Videonauth
            20 mins ago










          • You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
            – e200
            16 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          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: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2faskubuntu.com%2fquestions%2f1086021%2freuse-the-apt-up-part-of-the-apt-update-and-apt-upgrade-commands-to-execut%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):



          for i in date,grade; do
          apt up$i
          done


          The smart way is to make an alias in ~/.bashrc for these two commands and forget about retyping it ever again:



          alias upgrade=' apt update && apt upgrade'





          share|improve this answer






















          • Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
            – e200
            25 mins ago











          • @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
            – Sergiy Kolodyazhnyy
            21 mins ago






          • 2




            Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
            – Videonauth
            20 mins ago










          • You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
            – e200
            16 mins ago














          up vote
          2
          down vote













          The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):



          for i in date,grade; do
          apt up$i
          done


          The smart way is to make an alias in ~/.bashrc for these two commands and forget about retyping it ever again:



          alias upgrade=' apt update && apt upgrade'





          share|improve this answer






















          • Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
            – e200
            25 mins ago











          • @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
            – Sergiy Kolodyazhnyy
            21 mins ago






          • 2




            Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
            – Videonauth
            20 mins ago










          • You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
            – e200
            16 mins ago












          up vote
          2
          down vote










          up vote
          2
          down vote









          The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):



          for i in date,grade; do
          apt up$i
          done


          The smart way is to make an alias in ~/.bashrc for these two commands and forget about retyping it ever again:



          alias upgrade=' apt update && apt upgrade'





          share|improve this answer














          The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):



          for i in date,grade; do
          apt up$i
          done


          The smart way is to make an alias in ~/.bashrc for these two commands and forget about retyping it ever again:



          alias upgrade=' apt update && apt upgrade'






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 mins ago









          Melebius

          3,99051736




          3,99051736










          answered 26 mins ago









          Sergiy Kolodyazhnyy

          66.6k9134294




          66.6k9134294











          • Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
            – e200
            25 mins ago











          • @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
            – Sergiy Kolodyazhnyy
            21 mins ago






          • 2




            Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
            – Videonauth
            20 mins ago










          • You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
            – e200
            16 mins ago
















          • Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
            – e200
            25 mins ago











          • @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
            – Sergiy Kolodyazhnyy
            21 mins ago






          • 2




            Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
            – Videonauth
            20 mins ago










          • You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
            – e200
            16 mins ago















          Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
          – e200
          25 mins ago





          Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
          – e200
          25 mins ago













          @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
          – Sergiy Kolodyazhnyy
          21 mins ago




          @e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
          – Sergiy Kolodyazhnyy
          21 mins ago




          2




          2




          Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
          – Videonauth
          20 mins ago




          Just do the for loop in one line. for i in date,grade; do sudo apt up$i; done
          – Videonauth
          20 mins ago












          You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
          – e200
          16 mins ago




          You both right. But, it does not seems to be a good solution since its more easy to execute an apt update && apt upgrade rather then an for i in date,grade; do sudo apt up$i; done
          – e200
          16 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1086021%2freuse-the-apt-up-part-of-the-apt-update-and-apt-upgrade-commands-to-execut%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          One-line joke