9951 explained code solutions for 126 technologies


scpHow to transfer files using wildcards with SCP?


Wildcards can be used to transfer multiple files with SCP. The syntax for using wildcards is scp <source> <destination>.

Example

scp /home/user/files/*.txt [email protected]:/home/user/

This command will transfer all files with the .txt extension from the /home/user/files/ directory to the /home/user/ directory on the remote server.

Code explanation

  • scp: The command to initiate the file transfer
  • /home/user/files/*.txt: The source directory and wildcard for the files to be transferred
  • [email protected]:/home/user/: The destination directory on the remote server

Helpful links

Edit this code on GitHub