SFTP:将多个文件从一个文件夹移动(重命名)到另一个文件夹(不是一个接一个)

我需要将所有文件从current_path移动到current_path / DestinationFolder

我使用的SFTP版本是: SFTP协议版本2

可用的命令是:

sftp> help Available commands: cd path Change remote directory to 'path' lcd path Change local directory to 'path' chgrp grp path Change group of file 'path' to 'grp' chmod mode path Change permissions of file 'path' to 'mode' chown own path Change owner of file 'path' to 'own' help Display this help text get remote-path [local-path] Download file lls [ls-options [path]] Display local directory listing ln oldpath newpath Symlink remote file lmkdir path Create local directory lpwd Print local working directory ls [path] Display remote directory listing lumask umask Set local umask to 'umask' mkdir path Create remote directory put local-path [remote-path] Upload file pwd Display remote working directory exit Quit sftp quit Quit sftp rename oldpath newpath Rename remote file rmdir path Remove remote directory rm path Delete remote file symlink oldpath newpath Symlink remote file version Show SFTP version !command Execute 'command' in local shell ! Escape to local shell ? Synonym for help 

我没有mv命令。 我尝试了RNFT ,并没有工作。

现在,我可以使用重命名:

  rename current_path/myFile.txt current_path/DestinationFolder/myFile.txt 

没关系。 但是我需要移动所有 (或许多 )文件。 以下不起作用:

  rename current_path/* current_path/DestinationFolder/ Couldn't rename file "current_path/*" to "current_path/DestinationFolder/": Bad message 

没有通过SSH访问,所以我不能做的事情,如echo“ssh login @ server mv * current_path / DestinationFolder /”

我不应该惹这个服务器,这是:没有脚本,没有活动,等等。我非常有限。

你能推荐一种方法来解决这个问题吗?

:这是在SOLARIS。

我同意cjc。 如果你真的被限制在允许你下载文件的命令之上,则把local-path [remote-path]和scp放回去。 这里的链接也很好。

我会使用像winscp这样的东西,使事情变得更容易。

 sftp> help put USAGE: put local-path [remote-path] [-bg | -fg] [-s] [-o] [-r] [-b | -lf] DESCRIPTION: Upload file. PARAMETERS: -bg Start (queue) transfer in background. -fg Start transfer in foreground. -s Include subdirectories (recursive). -r Force existing incomplete file to be resumed. -o Force existing file to be overwritten. -b Upload all files as binary; no conversions. -lf Use auto detection upload mode. Text files are uploaded in Unix format, with LF as the line delimiter. NOTES: - If both '-r' and '-o' are specified, resume is tried first, and if that fails, overwrite is used. - '-std' and '-t' transfer mode options are also available when SFTP version 4 or higher is in use.