scp Command

To download a file from an Ubuntu server to a Mac, you can use the scp (secure copy) command. The scp command uses the SSH protocol for copying files between a local and a remote machine or between two remote machines.

Follow these steps to download a file from an Ubuntu server to your Mac:

  1. Open the Terminal app on your Mac.

  2. Use the scp command to download the file. Replace the placeholders in the following command with your actual information:

scp -i /path/to/your/key.pem ubuntu@your_server_ip:/path/to/remote/file /path/to/local/destination

For example, let’s say you have a file named example.txt on the Ubuntu server located at /home/ubuntu/example.txt, and you want to download it to the Downloads folder on your Mac. Your command would look like this:

scp -i /path/to/your/key.pem ubuntu@your_server_ip:/home/ubuntu/example.txt /Users/your_username/Downloads/
  1. After running the command, the file should be downloaded to the specified destination folder on your Mac.

Make sure to replace /path/to/your/key.pem with the actual path to your .pem file, ubuntu@your_server_ip with your server’s username and IP address, /path/to/remote/file with the remote file path on the Ubuntu server, and /path/to/local/destination with the destination folder on your Mac.