scp Command Generator
Generate scp commands to copy files between hosts
Getting Started with scp
## What is scp?
`scp` (secure copy) transfers files between two hosts over SSH. Either the source or the destination (or both) can be remote, written as `user@host:path`.
## How to Use
1. **Source and Destination**: one or both can be `user@host:path`. 2. **Toggle Flags**: `-r` for directories, `-P` for a custom port. 3. **Copy & Run**: paste the generated command into your terminal.
Flags & Patterns
``` scp file.txt user@host:/tmp/ scp -r dir/ user@host:/backup/ scp -P 2222 file.txt user@host:~/ ```
### Common flags - `-r` — copy directories recursively - `-p` — preserve modification times and permissions - `-C` — compress during transfer - `-P <port>` — port (capital P; ssh uses lowercase -p)
### Tips - The colon matters: `user@host:/path` is remote, `user@host` (no colon) is a local file named after the host. - For large or resumable transfers, prefer `rsync` over `scp`.
▶Why is it -P and not -p for the port?
▶How do I copy a whole directory?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee