How do I copy recursively like cp -rf *, but excluding hidden directories (directories starting with .) and their contents?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
||||
|
|
|
You could just copy everything with
and then delete hidden directories at the destination with
Alternatively, if you have some advanced tar (e.g. GNU tar), you could try to use tar to exclude some patterns. But I am afraid that is not possible to only exclude hidden directories, but include hidden files. For example something like this:
Btw, GNU tar has a zoo of exclude style options. My favourite is
|
||||
|
|
|
Good options for copying a directory tree except for some files are:
|
|||
|
|