Search code examples
sshscp

SSH SCP files from a list


I have a specific list of files that I need to copy from a remote server. Is this possible with SCP?

I know I can copy individual files using scp {user_name}@{host}:{filepath} . , but is there any way to take a .csv or .txt and run a foreach loop?


Solution

  • while read file; do scp "user@host:$file" .; done <  files