I want to scp all files of certain owners. For example, if this is my ls -la output:-rw-rw-r-- 1 owner1 ad   704 Jun  1 18:16 file1-rw-rw-r-- 1 owner2 ad   798 May 29 11:15 file2-rw-rw-r-- 1 owner2 ad   881 May 29 09:28 file3-rw-rw-r-- 1 owner3 ad   936 May 29 09:28 file4-rw-rw-r-- 1 owner1 ad  1012 Jun  1 15:14 file5I would like to scp all files of owner 1 and 3, so file1, file4, and file5.Is there something likescp login@some.cluster.nl:/path/to/folder/* . --owner owner1 owner2
How to scp all files of a certain owner?
shell;files;scp
The most efficient and safe way is probably find | tar | tar:ssh login@some.cluster.nl 'cd /path/to/folder; find . \( -user owner1 -o -user owner3 \) -print0 | tar --null -T - -cf -' | tar -xvf -You'd better review the tar archive content before extracting it.  Replace last | tar -xvf - to | tar -tvf - and run to get the file list.