SCP (Secure Copy Protocol) is a command-line utility that allows you to securely transfer files and directories between two locations. It uses SSH (Secure Shell) for data transfer, ensuring that your files are encrypted during the move.
The Basic Command Syntax
scp [options] [source] [destination]
Breaking Down the Parameters
scp: The command itself.
-r: (Recursive) Use this if you want to transfer an entire folder instead of just one file.
-P [port]: Use this if your SSH server is running on a custom port (default is 22).
user@host: The username and IP address of the remote machine.
:: The colon is crucial—it separates the host address from the file path.
path: The specific location of the file (e.g., /home/user/file.txt or C:/Users/Name/Desktop).
Examples to Try
1. Linux to Windows:
scp /home/ferdinand/data.zip [email protected]:C:/Users/Ferdinand/Desktop
2. Windows to Linux:
scp C:/Users/Ferdinand/Documents/notes.txt [email protected]:/home/ferdinand/
#files #programming #linux #windows #filetransfer