Copying Files from Remote Server with SCP Command
The SCP command, or secure copy, enables secure file transfers between a local host and a remote host, or between two remote hosts. For cases where you have data on the remote server and want to transfer it to your local machine, scp
works perfectly for those scenarios. Here's an example of how to use it:
scp ubuntu@<ip-address>:/home/ubuntu/Scripts/filename.csv .
Breaking down the example
Syntax | Example |
Username | ubuntu |
IP address of the host | <ip-address> |
Location of file on host | /home/ubuntu/Scripts/filename.csv |
Destination | . (current directory) |
💡 TIP: You can also press tab
to see what files are there in the remote directory and then proceed to choose the file