在Linux中,SFTP(SSH File Transfer Protocol)是一种安全的文件传输协议。以下是一些常用的SFTP命令:
sftp username@hostname
exit
bye
!command
ls
ls -l
cd directory
pwd
get remote-file local-file
put local-file remote-file
mget file_pattern
mput file_pattern
get remote-file
put local-file
!ls -l /remote/path
ls -l命令并显示结果。chmod permissions file
chown user:group file
touch file
rm file
rmdir directory
mkdir directory
!cp local-file remote-file
!mv remote-file new-name
!rm -r directory
!chmod 755 file
!chown user:group file
!df -h
!uptime
!前缀可以在SFTP会话中执行本地shell命令,但要注意安全性,避免执行不受信任的命令。通过这些命令,你可以有效地在Linux环境中使用SFTP进行文件传输和管理。