Linux – Copy files from Linux server to Mac desktop

linuxmacos

I have a folder on a Linux server and I have to transfer that file from there to my Mac desktop. I have never done it.

What is the best way to do that? I am trying to use terminal but is there any tool like WinSCP to do that?

Best Answer

  1. Install openSSH on the linux server. Assuming a debian based distribution, do this:

    sudo apt-get install ssh
    
  2. Open a terminal and copy the files:

    i. From Linux to Mac (run from the Linux machine):

    scp filename.txt user@remote_server:/Users/YOURNAME/
    

    ii. From Linux to Mac (run from the Mac):

    scp user@remote_server:/Users/YOURNAME/filename.txt .
    

The general syntax of the scp command is the following.

  1. To copy a file from the local server to the remote one:

    scp FILENAME user@remote_server:/remote/path/FILENAME
    
  2. To copy a file from the remote server to the local one:

    scp user@remote_server:/remote/path/FILENAME /local/path/FILENAME
    
Related Question