tags:

views:

41

answers:

3

My usual command for keeping the machine up to date is rather verbose, and it can result in more than one password prompt if any command takes a long time:

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean

I'd like to shorten this down to one command (preferably without using a global alias).

+1  A: 

http://www.gnu.org/software/bash/manual/bashref.html#Command-Grouping

weakish
+1 for link. Thanks!
l0b0
A: 

Try

sudo sh -c "apt-get update;apt-get dist-upgrade;apt-get autoremove;apt-get autoclean"
amra
A: 

Ok, it's really simple:

sudo (apt-get update && apt-get dist-upgrade && apt-get autoremove && apt-get autoclean)

Javaguru
bash: syntax error near unexpected token `apt-get'
l0b0