sftp 서버의 파일을 다른 디렉토리로 옮기려면 어떻게해야합니까? sftp를 사용하여이 서버에 연결 한 다음
mv myfile.csv /my/dir/myfile.csv
그러나 이것은 오류를 생성합니다. 이렇게하는 방법?
답변
mv
sftp의 대화식 모드 에는 명령 이 없습니다 . rename
대신 사용하십시오 .
사용할 수있는 명령 내용은 man 페이지를 확인 man sftp
하거나 유형을 help
내 sftp
.
답변
클라이언트 lftp
는 FTP와 SFTP 모두에 사용될 수 있습니다. mv
원격 서버에서 이동을 수행하는 데 사용할 수 있는 명령이 있습니다. 유닉스 : lftp 를 사용하여 유연하게 파일 이동하기 .
lftp
사용법 을 살펴보면 mv
명령이 나타납니다.
$ lftp
lftp :~> help
!<shell-command> (commands) alias [<name> [<value>]] attach [PID]
bookmark [SUBCMD] cache [SUBCMD] cat [-b] <files> cd <rdir>
chmod [OPTS] mode file... close [-a] [re]cls [opts] [path/][pattern] debug [<level>|off] [-o <file>]
du [options] <dirs> exit [<code>|bg] get [OPTS] <rfile> [-o <lfile>] glob [OPTS] <cmd> <args> help [<cmd>]
history -w file|-r file|-c|-l [cnt] jobs [-v] kill all|<job_no> lcd <ldir>
lftp [OPTS] <site> ln [-s] <file1> <file2> ls [<args>] mget [OPTS] <files>
mirror [OPTS] [remote [local]] mkdir [-p] <dirs> module name [args] more <files>
mput [OPTS] <files> mrm <files> mv <file1> <file2> [re]nlist [<args>]
open [OPTS] <site> pget [OPTS] <rfile> [-o <lfile>] put [OPTS] <lfile> [-o <rfile>] pwd [-p]
queue [OPTS] [<cmd>] quote <cmd> repeat [OPTS] [delay] [command] rm [-r] [-f] <files>
rmdir [-f] <dirs> scache [<session_no>] set [OPT] [<var> [<val>]] site <site-cmd> source <file>
torrent [-O <dir>] <file|URL>... user <user|URL> [<pass>] wait [<jobno>] zcat <files> zmore <files>