This command wont copy .htaccess files:
cp -Rdfp $source/* $dest/
Thanks
In bash, the *
glob doesn't include hidden files ('dotfiles') by default - you can enable that explicitly by setting the dotglob
shell option e.g.
shopt -s dotglob
cp -Rdfp $source/* $dest
You can unset the option after with shopt -u dotglob
.
Alternatively, if $dest
does not already exist, the much simpler
cp -Rdfp $source $dest
(avoiding the glob altogether) should work as well.
*
) does not expand to hidden files (starting with.
) by default. You should check the question from my previous comment for possible solutions. – Wayne_Yux Jun 17 '16 at 14:33