Codingcommands
Useful SFTP terminal commands
Useful SFTP terminal commands for frequent use
1 Min01 Dec, 2021

First Step - Connect to remote computer


sftp -i ~/.ssh/LightsailDefaultKey-ap-south-1.pem [email protected]


Similar to ssh command.

Output:


Connected to 52.66.180.155.

sftp>


Remote and Local computer commands

When we relay basic terminal commands at sftp> like 'pwd, ls, cd, and it executed at remote computer.

Basic terminal commands above when prefix with l like lpwd, lls, lcd and etc. it executed at local computer.

For e.g.

List all files in the present working directory at remote computer:


sftp> ls

List all files in the present working directory at local computer:


sftp> lls

Sending a local computer file to present working directory of remote computer


sftp> put /Users/mj/Downloads/test.png


Output


Uploading /Users/mj/Downloads/test.png to /home/ubuntu/test.png

/Users/mj/Downloads/tech-mrit-prod.ovpn 100% 13KB 382.9KB/s 00:00

    

References

  1. How To Use SFTP to Securely Transfer Files with a Remote Server
Mrityunjay
© 2021, All Rights Reserved
Made In India 🇮🇳 with ❤️
Quick Links