I want to do something like this in bash:
scp me@server:/data/stuff/*/needthis.txt ./?/needthis.txt
Where that ? in the command will be whatever was matched by the *.
My problem is there’s a bunch of directories out of which I want to copy one file that’s the same name in each directory, and I want to preserve the name of the directory they came from, but I don’t just want to copy the entire “stuff” folder because there are other files in these directories that are hundreds of MB which I don’t want to waste time downloading.
Can I do this easily?
Perhaps
rsyncis what you need: