====
Files which are not to be deleted
Wp-config.php
Wp-content
====

Steps:

Upgrading the wordpress

Take a back up of public_html or the directory where wordpress is installed

#cp -pr public_html public_html.bak

download:

#wget http://wordpress.org/latest.tar.gz  (Download .tar.gz — 3.4 MB)
#tar -xvzf latest.tar.gz

A directory “wordpress” is formed in the public-html ( where the word press is installed)
Copy all the contents of “wordpress” into the public_html or to the directory where wordpress installed.
#/bin/cp -pr * ../        (standing at directory wordpress)  (‘ /bin ‘ to overwrite all the datas)
Restore back the wp-config.php and wp-contends to the public_html from the backuped directory (i.e. old Wp-config.php Wp-content)
#/bin/cp -pr /wp-contents wp-config.php /home/domain/public_html

Change the permissions of files in downloaded to public_html

#chown -R username.username *
============
At the browser:

<domainname>/wp-admin

upgrade the database
proceed with that.
cat ./wp-includes/version.php