How to make scp copy hidden files?

That should absolutely match hidden files. The / at the end of the source says “every file under this directory”. Nevertheless, testing and research bear you out. This is stupid behavior.

The “answer” is to append a dot to the end of the source:

scp -rp src/. user@server:dest/

The real answer is to use rsync.

Leave a Comment