SFTP常用命令

在计算机领域,SSH文件传输协议(英语:SSH File Transfer Protocol,也称Secret File Transfer Protocol,中文:安全文件传送协议,英文:Secure FTP或字母缩写:SFTP)特点是走SSH,速度比ftp稍慢但安全性更高。

先贴一下help的原版文档(其实看了就都懂了吧)

Available commands:
 bye                                Quit sftp
 cd path                            Change remote directory to 'path'
 chgrp [-h] grp path                Change group of file 'path' to 'grp'
 chmod [-h] mode path               Change permissions of file 'path' to 'mode'
 chown [-h] own path                Change owner of file 'path' to 'own'
 df [-hi] [path]                    Display statistics for current directory or
                                    filesystem containing 'path'
 exit                               Quit sftp
 get [-afpR] remote [local]         Download file
 help                               Display this help text
 lcd path                           Change local directory to 'path'
 lls [ls-options [path]]            Display local directory listing
 lmkdir path                        Create local directory
 ln [-s] oldpath newpath            Link remote file (-s for symlink)
 lpwd                               Print local working directory
 ls [-1afhlnrSt] [path]             Display remote directory listing
 lumask umask                       Set local umask to 'umask'
 mkdir path                         Create remote directory
 progress                           Toggle display of progress meter
 put [-afpR] local [remote]         Upload file
 pwd                                Display remote working directory
 quit                               Quit sftp
 reget [-fpR] remote [local]        Resume download file
 rename oldpath newpath             Rename remote file
 reput [-fpR] local [remote]        Resume upload file
 rm path                            Delete remote file
 rmdir path                         Remove remote directory
 symlink oldpath newpath            Symlink remote file
 version                            Show SFTP version
 !command                           Execute 'command' in local shell
 !                                  Escape to local shell
 ?                                  Synonym for help

SFTP不同于SSH会一直显示当前目录,这里说几个最常用的用法

#登录,使用时是没有括号的
sftp [user]@[ip]

#退出,这两个没发现区别
bye
quit

#进入某个目录
cd

#查看现处于远端服务器的目录
pwd

#查看现处于本地的目录
lpwd

#上传文件,拖拽显示路径非常方便
put

#下载文件
get

#在本地shell中执行命令,使用时没有括号
![command]

4 comments

      1. 怎么你也喜欢阳光彩虹Hawaii吗

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注