423
127
How can I make cp -r
copy absolutely all of the files and directories in a directory
Requirements:
- Include hidden files and hidden directories.
- Be one single command with an flag to include the above.
- Not need to rely on pattern matching at all.
My ugly, but working, hack is:
cp -r /etc/skel/* /home/user
cp -r /etc/skel/.[^.]* /home/user
How can I do this all in one command without the pattern matching? What flag do I need to use?
1
More answers here, though they do not look as good; http://serverfault.com/questions/3154/recursively-copying-hidden-files-linux/
– Roel Van de Paar – 2016-06-01T08:43:54.620Please, Eleven81, consider changing the accepted answer to that given by @bruno pereira, because it avoids creating a new folder. If not, let this comment be a warning to new readers to check also the other (most voted) answer. Tx. – Dr Beco – 2016-07-12T20:27:10.037