Is there a command to move a file from my droplet to local?

I’ve been using GitHub to move files between my droplet and my computer, which works fine.

But I was wondering if there’s a way through command line to move files from the droplet to my local machine.

Thank you

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi @jouo,

You can use either rsync or scp to move files from one place to another.

Let’s use scp for this example as it’s simpler(in this case). You’ll need to use it like so

scp root@YourDropletIp:/path/to/your/file/file.txt /local/path/where/it/should/be/saved

If you have any custom SSH port on your droplet, you can use it like so

scp -P 2222 root@YourDropletIp:/path/to/your/file/file.txt /local/path/where/it/should/be/saved

And if you wish to copy files recursively, you can do it by executing the command as

scp -r root@YourDropletIp:/path/to/your/file/file.txt /local/path/where/it/should/be/saved

Regards, KDSys

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.