One of the best way to upgrade your WordPress version in command line with only 3 simple steps.
- Download the compressed file from https://wordpress.org/download/ and unzip it.
tar -xzvf latest.tar.gz
- Copy and overwrite the core files
cp -avr /tmp/wordpress/* .
rm -rf wordpress latest.tar.gz
- Open and login your WordPress site to upgrade the core.