Home » Questions » Computers [ Ask a new question ]

I would like to pipe output of find into input list of scp, how?

I would like to pipe output of find into input list of scp, how?

I'm a novice linux user and I am trying to send a long list of files from one computer to another. The argument list is too long, so I am using find. I am having trouble setting up the expression, though. Can someone help?

Asked by: Guest | Views: 421
Total answers/comments: 2
Guest [Entry]

"find . -name ""*"" -exec scp '{}' phogan@computer:/directory ';'

Normally I would 'tar' all the files together into one huge blob and call 'scp' just once. Something like this:

tar czfv - file1 file2 dir1 dir2 | ssh phogan@computer/ tar xvzf - -C directory

One could play around with the --exclude= or --include= parameters of tar.
Another option would be to use rsync."
Guest [Entry]

for f in `find . -name "*"`;do scp $f phogan@computer/directory;done