I have a three folders: core, project and merge with many files inside. I want to delete all files and folders (including dot files) inside the merge folder, and then copy all files (including dot files) from the core folder to the merge folder, as well as merge all files in the project folder into the merge files.
Situations
- How can i remove all files and folders (including dot files) from special folders, without removing them? (
rm -rf /path/to/folder/*
did not delete files and folders.) - What is fastest way to copy (with and without merge and replace) all files recursively from special folder to another one (including dot files)? (
tar -cf my.tar path/; tar -xf my.tar
)
I'm using tar but there are too many files and I need a faster way.
Deletion
You can safely ignore that warning. Personally, I'd probably just
rm -r merge
and nuke the directory itself.Copying
... but that will overwrite the merge directory.
A bit slower and harder to write, but functional and doesn't clobber the parent directory.
All at once