Ubuntu check for update and install those update command

I need to first check for update from the terminal session. How can I check for update and install those update using command line options on an Ubuntu Linux server?

How to get a list of packages that can be upgraded on Ubuntu?

Try

sudo apt update
sudo apt list --upgradable


See 8 packages can be upgraded. So apply them using the apt command as follows

sudo apt upgrade

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