domingo, 5 de mayo de 2013

Downloading file from my server to my local


To download the file "serials.txt" from your remote home dir to the local computer:

scp user@server.com:serials.txt .

To download the remote file "something" using it's full path to your local computer:

scp user@server.com:/path/to/file/something.txt .

Now the tricky part: using the recursive switch (-r) to download a whole folder to your local computer. The issue you may have is that you DO NOT place a trailing forward slash after the directory name. For instance, this command will NOT work (notice the bold forward slash):

scp -r user@server.com:/path/to/directory/ .

This will give you a message saying the server is trying to write to the parent directory. REMOVE the last foward slash on the path and try again. The next command is CORRECT:

scp -r user@server.com:/path/to/directory .

I have been using a period when talking about downloading so far. Reason: this brings the file into the directory you are currently in. If you wish to take the last command and download it to somewhere else, the command would be:

scp -r user@server.com:/path/to/directory /new/local/location/

No hay comentarios:

Publicar un comentario

Entradas populares