There are some reasons why we have to upgrade wordpress via command line in linux shell.
- Upgrade in admin panel fail because of network connection happen in upgrade process
- No FTP account to upgrade (if hosting require)
- File permission problem
- Security problem
It ‘s quite easy, let ‘s do these steps to upgrade wordpress in command line.
1. Login to server via SSH account
2. Download the latest version of wordpress and unzip via command line with this way
$ cd /tmp
$ wget http://wordpress.org/latest.zip
$ unzip latest.zip
3. Then Overwrite all new files
$ cd /var/www/html/blog
$ cp -avr /tmp/wordpress/* .
$ rm -rf /tmp/wordpress /tmp/latest.zip
Now login to admin panel of wordpress it will require you upgrade database, just perform the action and everything will be done.