The scp command transfers a file from one server to another securely in linux environments.

Most if not all linux flavors come with the scp command pre-installed, but if not you can find the package in your repository.

To copy a file from your local server to remote server:

scp /local/file/path remote_user@remote_domain_or_ip:/remote/file/path

you will then be prompted for the password for remote_user in order to complete the operation.

To copy a file from a remote server to your local server:

scp remote_user@remote_domain_or_ip:/remote/file/path /local/directory

To copy a directory from local to remote recursively (copy a directory and all of its contents including subdirectories):

scp -r /local/directory remote_user@remote_domain_or_ip:/remote/directory