Let say I have a file /home/user/dir1/file.txt
on a remote SFTP server. I want to copy this file to lets say /home/user/dir2/file.txt
, while I am in a sftp
session (I have server which allows only sftp
connections, but no ssh
connections!) connected to this server?
Is it possible to do so? If yes, what is the command?
For example the following command would rename move a file from one directory to another on the remote server.
sftp> rename dir1/file.txt dir2/file.txt
I am looking for a command which would copy a file from one directory to another on the remote server, if one exists.
The work around is to download the file from first location and upload to the second location, but that is not an option when the file in question is a big one and one is working with a slow network connection!