# scp & Checking Connectivity — Linux

Source: https://www.geekswithgeeks.com/en/linux/linux-scp-connectivity

> Copying files over SSH, and confirming a host is reachable.

## scp — copy over SSH

`scp` copies files to or from a remote machine using the same auth as SSH.

```bash
scp report.pdf alice@myserver.com:/home/alice/
scp alice@myserver.com:/var/log/app.log ./app.log
```

## Checking connectivity

`ping` tests basic reachability. `curl -I` checks whether a web service responds.

```bash
ping -c 4 google.com
curl -I https://example.com
```

Output:

```
4 packets transmitted, 4 received, 0% packet loss
HTTP/1.1 200 OK
```

**Quiz:** Which command copies a file to a remote server over SSH?

- [ ] ssh
- [x] scp
- [ ] ping

*Answer:* scp. scp (secure copy) transfers files using the SSH protocol.
