Sometimes we need to download files from a remote host to our local pc through a terminal. SCP is a good tool to do this job. SCP is a secure remote file copy program which copies files between hosts in a network. To use SCP for file downloading allow the following command:
$ scp -P 9999 user@myhost.com:/path/to/file .
The -P tells the port of the host to connect in. As SCP uses SSH to do the copying things so “user@myhost.com” is the username and hostname of the remote host from which we are doing the download. After that we added a colon “:” and next is the path of the file which we want to download. The last dot “.” is the path in the local host where the file will be downloaded. The dot “.” means the current dir where the command is being applied. If you want to download in the /home dir then apply the command like this:
$ scp -P 9999 user@myhost.com:/path/to/file /home
To know more about SCP just see its manual which contains various other important info which may need in several other special cases. To see the manual of scp just type “man scp” in your terminal. Hope this small piece of info will help you.
