这个工具可以使用跟ssh协议进行文件传输,在一些情况下还是挺好用的
用连接远程计算机

   sftp root@192.168.1.1


登录成功后用help可以看到sftp的基本指令

   Available commands:
   bye                                Quit sftp
   cd path                            Change remote 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'
   df [-hi] [path]                    Display statistics for current directory or
                                      filesystem containing 'path'
   exit                               Quit sftp
   get [-Ppr] remote [local]          Download file
   reget remote [local]	Resume 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 [-Ppr] local [remote]          Upload file
   pwd                                Display remote working directory
   quit                               Quit sftp
   rename oldpath newpath             Rename remote 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


简单的做个总结,在可以直接使用lls cd pwd这些命令进行路径操作
要对本地的命令进行操作的话,需要在这些基础命令的前面加上一个字母"l"
也就是cd变成了lcd,pwd变成了lpwd,ls变成了lls
若要从对方机器上下载文件到本地的话,使用get命令

   get /etc/hosts


这样就下载到了本地的当前目录下了
若要从本地上传文件到对方机器,可以使用put命令

   put /etc/hosts


若要上传或者下载整个目录,则加上-r参数即可

   get -r ./hello
   put -r ./12345


操作完之后退出也有好几个命令

   exit
   quit
   bye


这个工具在进行文件传输的时候还是很方便的,能够进行交互式的文件管理操作,但是有一些系统比如OpenWRT之类的话,可能会默认没安装sftp-server,这个时候也就只能用scp了。