Put star (*) in to copy but ignore hidden files
cp -urL -r /path/to/dir/A/* /path/to/dir/B
If using bash as your shell, unset the dotglob shell option.
bash
dotglob
man bash
dotglob If set, bash includes filenames beginning with a '.' in the results of pathname expansion.
#!/bin/bashshopt -u dotglobcp -urL /path/to/dir/A /path/to/dir/B