Linux / UNIX scp Copy Hidden . (Dot) Files

in Categories last updated November 9, 2010

How do I copy all hidden files from $HOME using scp command line tool?

scp is secure remote copy program which copies files between hosts on a network. The correct syntax to copy all hidden files using scp is as follows:
$ scp -rp /path/to/source/. user@server2.cyberciti.biz:/path/to/dest/
You need to append a dot to the end of the source so that it will copy all files. A better solution is to use the rsync command as follows:
$ rsync -av --progress /path/to/source user@server2.cyberciti.biz:/path/to/dest/

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 1 comments/add one below):

1 comment

    Have a question? Post it on our forum!