How to apply .diff and .patch file by SSH? I use Drupal 7 and I read every article about applying patches, but I don't understand how to apply patches to Drupal files using SSH. I am administrator of a Linux server that hosts a Drupal site.

Can anybody help me?
After logging in to your site with SSH, in order to apply patches, you should have or install a program on your server. patch is the most widespread one, but you can also use git for it.

You can find more documentation on applying patches in the Drupal site: https://www.drupal.org/patch/apply