How to run multiple commands in sudo under Linux or Unix

Originally published at: https://www.cyberciti.biz/faq/how-to-run-multiple-commands-in-sudo-under-linux-or-unix/

I am a new Linux user. How do I run two commands from a bash shell? I need to run apt-get update and apt-get -y upgrade without typing sudo command two times from a command line on Ubuntu Linux AWS cloud server. How can I two commands in sudo ‘command1 && command2’?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki