scpHow to SCP multiple files?
You can use the scp
command to securely copy multiple files from one host to another.
Example code
scp file1.txt file2.txt user@host:/path/to/destination
This command will copy both file1.txt
and file2.txt
to the /path/to/destination
directory on the host user@host
.
You can also use wildcards to copy multiple files at once. For example, the following command will copy all files with the .txt
extension from the current directory to the /path/to/destination
directory on the host user@host
:
scp *.txt user@host:/path/to/destination
You can also use the -r
flag to recursively copy entire directories. For example, the following command will copy the my_dir
directory and all of its contents to the /path/to/destination
directory on the host user@host
:
scp -r my_dir user@host:/path/to/destination
Helpful links
More of Scp
- Running SCP in quiet mode
- Is it possible to SCP files in parallel?
- How to show progress when using SCP?
- How to overwrite files using SCP?
- How to transfer files using wildcards with SCP?
- How to use an SSH key when using SCP?
- How to automatically create destination directory when using SCP?
- How to run SCP in verbose mode?
- How to use a different port when using SCP?
- How to use SCP with a password?
See more codes...