FTP do not have mv command. You have to use rename command
The concept is generate a todo file to rename(move) each file one by one
full script to achieve move more than one file.
get file list from ftp server with mls command
generate to do list file
2.1 get file , for demo you can do more actions on text file
2.2 rename (move file)execute ftp command with to do list file
#!/bin/sh clear
change local directory
cd [local-directory]
#collect file names ftp -ni ftp.abccompany.com <<EOF user [user] [password] cd /OUT mls abc*.* list.txt quit EOF
create ftp action list
echo >>todo.lst user [user] [password] while read N do #echo >>todo.lst cd /OUT #for demo you can do more actions on text file #echo >>todo.lst get $N #for demo you can do more actions on text file echo >>todo.lst rename $N ARCHIVE/$N #did not change file name, move directory only done <list.txt
echo >>todo.lst quit
ftp transfer process
ftp -nv ftp.abccompany.com <todo.lst
cleanup
rm todo.lst