Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

Thursday, January 5, 2017

Linux - How to copy all files including hidden with cp command

Sometimes we need to copy an entire folder, including all its content from one location to another. For that purposes we can use cp command. But most of users (including me) experience problems with it. If you try to copy files using star wildcard "*", it wont copy hidden files and folders.

For example:
mkdir /tmp/dir1
cp -r /home/username/* /tmp/dir1
This method does not copy hidden files and folders, such as '/home/username/.bashrc'.