I have two directories and one is empty.
The first directory has many sub directories with hidden files. When I cp -r
content from first directory to the second one, the hidden files gets copied too. Any solutions to escape them?
Join Stack Overflow to learn, share knowledge, and build your career.
I have two directories and one is empty.
The first directory has many sub directories with hidden files. When I cp -r
content from first directory to the second one, the hidden files gets copied too. Any solutions to escape them?
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.