Linux / UNIX scp Copy Hidden . (Dot) Files

Linux / UNIX scp Copy Hidden . (Dot) Files

To copy hidden files (files that begin with a . character) using the scp command in Linux or Unix, you can use the -r option to recursively copy directories and the -a option to preserve file attributes such as permissions, timestamps, and symbolic links.

For example, to copy all hidden files in the current directory to the /home/user/backup directory on a remote host, you can use the following scp command:

scp -r -a . user@remote:/home/user/backup
Source:w‮w‬w.lautturi.com

This will copy all hidden files in the current directory, including any subdirectories, to the /home/user/backup directory on the remote host. The -r option tells scp to copy directories recursively, and the -a option preserves file attributes such as permissions, timestamps, and symbolic links.

By using the -r and -a options, you can copy hidden files using the scp command in Linux or Unix. It's always a good idea to carefully review the documentation and use the appropriate options and syntax when working with scp. This will help ensure that your files are copied correctly and that any problems are detected and addressed.

Created Time:2017-10-29 22:08:55  Author:lautturi