I am connecting to my remote sftp using below command:
sftp user@host
After inputing password next I get sftp prompt i.e.
sftp>
My job is to move multiple files from directory A to directory B. I am able to do this via rename command but only single file at a time. Is there any command/syntax which can move list of files from directory A to directory B. Something like below:
rename /A/file1 /A/file2 B/
Just to add I have to do it via command line only by using sftp protocol and Not any tool like fileZilla or winscp.
ftp
clients vary widely in tools/options. I'm not so sure aboutsftp
(and we don't know what version you are using), but recall thatftp
has a group ofm
commands (for multi, I suppose):mget
,mput
(at least). Check your online help to see if there are otherm
commands in your version ofsftp
. Good luck! – Seoulrename
commands. Or maybeperl
andpython
have functions that will help with this. Good luck. – Seoullftp
client hasmmv
option... lftp.yar.ru/lftp-man.html – Mandrelsftp
as @PaulHodges has done withssh
(which might be an option for you too), except to build up a string that has all therename
commands embedded. I have done such things with unhelpfulftp
clients, so I think it would be possible forsftp
. Good luck. – Seoul