Linux / UNIX scp Copy Hidden . (Dot) Files

In Linux and UNIX, hidden files are files that start with a dot (.) character. To copy hidden files using scp, you simply need to include the file name with the dot in the source and destination paths.

Here’s an example of copying a hidden file named .myfile from the local machine to a remote host:

scp .myfile user@remote_host:/path/to/destination

And here’s an example of copying a hidden file from a remote host to the local machine:

scp user@remote_host:/path/to/source/.myfile .

Note that in the second example, the dot (.) at the end of the destination path is used to indicate the current working directory on the local machine.

(https://attap.umd.edu/)

Leave a Comment