加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 建站 > 正文

十分钟学会SSH+SFTP操作终端,告别XShell

发布时间:2019-08-13 14:26:09 所属栏目:建站 来源:极客知音
导读:1.前言 在Mac下登陆远程服务器并没有Windows那么方便的使用XShell,相比较而言,在Mac下更多的是依赖终端输入SSH命令登录远程服务器。 使用SSH命令行的好处就是可以近距离接触底层,用的越多,用的越溜,对SSH的原理就越了解。相反,使用现成的SSH工具(PuT

输入 help 命令可以查看sftp支持的命令操作:

  1. sftp> help 
  2. Available commands: 
  3. bye Quit sftp 
  4. cd path Change remote directory to 'path' 
  5. chgrp grp path Change group of file 'path' to 'grp' 
  6. chmod mode path Change permissions of file 'path' to 'mode' 
  7. chown own path Change owner of file 'path' to 'own' 
  8. df [-hi] [path] Display statistics for current directory or 
  9.  filesystem containing 'path' 
  10. exit Quit sftp 
  11. get [-afPpRr] remote [local] Download file 
  12. reget [-fPpRr] remote [local] Resume download file 
  13. reput [-fPpRr] [local] remote Resume upload file 
  14. help Display this help text 
  15. lcd path Change local directory to 'path' 
  16. lls [ls-options [path]] Display local directory listing 
  17. lmkdir path Create local directory 
  18. ln [-s] oldpath newpath Link remote file (-s for symlink) 
  19. lpwd Print local working directory 
  20. ls [-1afhlnrSt] [path] Display remote directory listing 
  21. lumask umask Set local umask to 'umask' 
  22. mkdir path Create remote directory 
  23. progress Toggle display of progress meter 
  24. put [-afPpRr] local [remote] Upload file 
  25. pwd Display remote working directory 
  26. quit Quit sftp 
  27. rename oldpath newpath Rename remote file 
  28. rm path Delete remote file 
  29. rmdir path Remove remote directory 
  30. symlink oldpath newpath Symlink remote file 
  31. version Show SFTP version 
  32. !command Execute 'command' in local shell 
  33. ! Escape to local shell 
  34. ? Synonym for help 

执行本地命令

如果我们想在进入sftp会话环境下执行本地命令怎么办?只需要在本地命令之前加叹号!即可,示例如下:

  1. !ls 

退出会话

无论是在 ssh 还是 sftp,都可以使用 exit 退出当前会话,sftp 还可以使用 quit 命令退出。

12.结语

相信本文足以可以让你解决使用终端过程中碰到的绝大多数问题了。

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读