Monday, June 19, 2017

Linux command to copy folder with hidden files

If cp command doesn't seem to work for you, and you see that hidden files are not getting copied to the destination directory, it's probably time to try rsync command!

Instead of:

cp src_dir target_dir -r

You can use:

rsync -av src_dir target_dir

Please note: Trailing slash is super important in rsync sytax. If you omit slash at the end of source directory, a new subdirectory will be created inside of target directory.

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...