SCP Command

Get in Touch With Us
Submitting the form below will ensure a prompt response from us.
The scp (secure copy) command is used to copy files or directories between computers over SSH. Here’s the basic syntax:
Basic Syntax:
bash
scp [options] source destination
Common Examples:
1. Copy a file from local to remote:
bash
scp myfile.txt user@remote_host:/path/to/destination/
2. Copy a file from remote to local:
bash
scp user@remote_host:/path/to/myfile.txt /local/destination/
3. Copy a directory recursively:
bash
scp -r myfolder/ user@remote_host:/path/to/destination/
4. Use a custom SSH port (e.g., port 2222):
bash
scp -P 2222 myfile.txt user@remote_host:/path/
Tips:
- user is your SSH username.
- remote_host can be an IP address or domain.
- Always quote paths with spaces, e.g., “/path/with space/file.txt”

About Author
Bhavik Koradiya is the CEO / Co. Founder of Silver WebBuzz Pvt. Ltd. Having 18+ years Experience in LAMP technology. I have expert in Magento, Joomla, WordPress, Opencart, e-commerce and many other open source. Specialties: Magento, WordPress, OpenCart, Joomla, JQuery, Any Open source.
Related Q&A
[related_qa]