cp -r without hidden files cp -r without hidden files linux linux

cp -r without hidden files


You can use rsync:

rsync -av --exclude=".*" src dest


You can do

cp -r SRC_DIR/* DEST_DIR

to exclude all .files and .dirs in the SRC_DIR level, but still it would copy any hidden files in the next level of sub-directories.


rsync has "-C" option

http://rsync.samba.org/ftp/rsync/rsync.html

Example:

rsync -vazC  dir1 dir2