SCP (Secure Copy Protocol) is a command-line tool in Linux that allows you to securely transfer files and directories between computers over a network. Here’s a quick and basic guide on how to use SCP.
1. Basic Syntax
The basic syntax for using SCP is:
Where ‘source_file’ is the path to the file you want to copy and ‘destination_file’ is the path where you want to copy the file.
2. Copying a File from Local to Remote
To copy a file from your local machine to a remote server:
4. Copying a Directory Recursively
To copy an entire directory and its contents, use the -r option:
Alternatively, you can also use the -3 option with SCP on your local machine to allow the local machine to serve as an intermediary:
Conclusion:
SCP is a straightforward and secure way to transfer files between machines over a network. With these basic commands, you can easily copy files and directories to and from remote servers. Happy copying!