pacman can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases and update the system's packages (excluding "local" packages that are not in the configured repositories):
# pacman -Syu
Querying package databases
pacman queries the local package database with the -Q flag; see:
$ pacman -Q --help