加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-15 18:34:35 所属栏目:安全 来源:网络整理
导读:我需要将所有文件从current_path移动到current_path / DestinationFolder. 我正在使用的SFTP版本是:SFTP协议版本2 可用的命令是: sftp helpAvailable commands:cd path Change remote directory to 'path'lcd path Change local directory to 'path'chgrp
我需要将所有文件从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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读