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

前端之家收集整理的这篇文章主要介绍了unix – 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访问所以我不能做回声“ssh login @ server mv * current_path / DestinationFolder /”

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

你能给我一个解决这个问题的方法吗?

注意:这是在SOLARIS中.

我同意cjc.如果您真的被限制在允许下载文件的命令之上,则将local-path [remote-path]放入其中并将其scp.好的链接 here也是.

我会使用像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.
原文链接:https://www.f2er.com/bash/385647.html

猜你在找的Bash相关文章