I am using ssh to connect to a server. I want to upload local files to the server. Usually I do this by opening the 'New File Transfer Window' However, i'd like to just do this from the command prompt.
what is the command to do this?
I am using ssh to connect to a server. I want to upload local files to the server. Usually I do this by opening the 'New File Transfer Window' However, i'd like to just do this from the command prompt.
what is the command to do this?
You can do this with rsync
.
Something like this should suffice:
rsync -av /path/to/Desktop/ server.name:/path/to/destination
The -av
tells rsync
to 'archive' (maintains permissions, acts recursively, etc) and to be verbose (print transferred filenames).
Note: if you leave a trailing / at the end of 'Desktop', the contents of the Desktop will be transferred. Without the slash, all documents will be transferred into a folder called 'Desktop' on the destination.
Since you mention the "New File Transfer" window, my guess is that you're using the ssh.com SSH2 client.
SCP2.EXE is the program to copy files over ssh from the command line.
Sometimes for small text files I copy the contents to the clipboard then paste it to cat
in the terminal window. E.g.
cat > path/to/file