Using a single sudo to run multiple && arguments

sudo sh -c 'apt update -y && apt upgrade -y'
This will also work with bash instead of sh shell sudo bash -c 'apt update -y && apt upgrade -y'

1
By: ioshield
2019-07-31 04:39:40

1 Alternatives + Submit Alt

What Others Think

Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. what to see in cozumel
xoheko1229 · 38 weeks and 1 day ago
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. tulum ruinas
xoheko1229 · 37 weeks and 6 days ago
Thank you a bunch for sharing this with all of us you actually realize what you are talking about! Bookmarked. Please also seek advice from my site =). We could have a hyperlink change contract between us! top things to do in cancun
xoheko1229 · 37 weeks and 4 days ago
Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!! isla mujeres top restaurants
xoheko1229 · 37 weeks and 2 days ago
Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic. If possible, such as gain knowledge, would you mind updating your blog with additional information? It is very useful for me. holbox tour
xoheko1229 · 37 weeks and 1 day ago
This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. holbox island resorts
xoheko1229 · 37 weeks and 1 day ago
Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. treatnheal
xoheko1229 · 35 weeks and 3 days ago
I have been looking for this! guitar lessons portland
aegyjingoo · 34 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: