Xsheel下sftp简单命令整理

本文详细介绍了如何通过SFTP(SecureFileTransferProtocol)在Linux命令行中进行远程服务器的登录、路径管理、文件操作(包括查看、下载、上传)以及退出,提供了一套完整的指南。
摘要由CSDN通过智能技术生成

1. 登录到远程服务器

sftp 用户名@ip
sftp root@192.168.1.200

# 按提示输入密码后,进入到当前用户目录下

2. 查看本地当前路径/远程当前路径

# 查看本地当前路径
lpwd

# 远程当前路径
pwd

3. 查看本地当前路径/远程当前路径下的文件

#查看本地当前路径下的文件
lls

#查看远程当前路径下的文件
ls

4. 切换本地路径/远程路径

# 切换本地目录
lcd 

# 切换远程目录
cd 

5. 下载远程文件到本地

# 将远程当前路径下的a.txt文件下载到本地当前路径下
get a.txt

# 查看本地当前路径下是否存在已下载文件
lls

6. 上传文件到远程

# 将本地当前路径下的a.txt文件上传到远程当前路径下
put a.txt

# 查看远程当前路径下是否存在已上传文件
ls

7. 退出sftp

exit

quit

bye

#三者皆可

8. 查看帮助

help

# 结果如下
bye     finish your SFTP session
cd      change your remote working directory
clear   clear screen
exit    finish your SFTP session
explore explore your local directory
get     download a file from the server to your local machine
help    give help
lcd     change and/or print local working directory
lls     list contents of a local directory
lpwd    print your local working directory
ls      list contents of a remote directory
mkdir   create a directory on the remote server
mv      move or rename a file on the remote server
put     upload a file from your local machine to the server
pwd     print your remote working directory
quit    finish your SFTP session
rename  move or rename a file on the remote server
rm      delete a file
rmdir   remove a directory on the remote server

  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值