Copying hidden files with RSYNC is a straightforward process that many Linux administrators utilize for tasks involving file transfer and synchronization. The files start with a period (“.”) in UNIX-based systems, including Linux, and they are considered hidden by default.
Rsync, a fast and extraordinarily versatile file transferring tool originally designed by Andrew Tridgell, can copy hidden files. When utilized properly, administrators can use Rsync to transfer or copy hidden files efficiently.
To copy hidden files using Rsync, we use the “-a” option, which is an abbreviation for “archive.” The -a option preserves not only file permissions and timestamps but also hidden files.
Here is an example of how this option can be used:
```
rsync -a /source/directory/ /destination/directory/
```
In the above command, replace ‘/source/directory/’ with the absolute path to the directory the files are being copied from, and ‘/destination/directory/’ with the absolute path to the directory the files are being copied to. This command will copy all files, including all hidden files, from source to destination while maintaining their original attributes.
Sometimes, if you want to only copy the hidden files and not the normal files you can use the following command:
```
rsync -av —include=’.’ —exclude=’’ /source/directory/ /destination/directory/
```
This will only copy the hidden files, ignoring non-hidden files.
In addition to copying hidden files, rsync can provide a bevy of additional functionalities that can be extremely useful. For instance, it can improve file transfer speeds by compressing the data during transit and reduce data that needs to be sent by only sending the differences between the source files and the existing files at the destination.
While rsync is a richly featured tool, users must understand the essential options and how to leverage them to fully benefit from its capabilities. The “—delete” option, for instance, will delete files at the destination if they’re not existing at the source, while the “—dry-run” is useful for testing your rsync commands as it simulates a run without making actual changes.
These examples and explanations for using rsync to copy hidden files are widely discussed across a variety of tech-focused websites, including the manpages (manual pages) of Linux distributions where rsync is referenced (source: man rsync), and different Linux forums and websites like Stack Exchange, Linux Handbook, and TecMint.
It’s highly recommended to check the rsync manpages or the official rsync website for comprehensive information, since rsync comes with lots of options, and each option can drastically alter the result.