Gregg's MOTD

Tips & Tricks that I've Encountered Over the Years...

scp’ing Files using a Text File List

July 12, 2023 — Gregg Szumowski

If you have a collection of files that you want to transfer to a remote server and they are a subset of files in the current directory or scattered among different directories you can create a list of files and then pipe the list to scp:

$ cat filelist.txt | xargs -i scp {} user@remote:~/backup/

Tags: cli, xargs, scp, motd