Update apps in mac appstore from command line in osx

This is a cool tip from cult of mac:

you can update your appstore apps from the commandline!

to show a list of the apps with available updates,

sudo softwareupdate -l

to update all apps

sudo softwareupdate -i -a

you could potentially use this in a cron job to update everything as it comes out without having to do anything :D