4 ms·
Ask HN: Why doesn't cp have a flag to replace directories (like Finder)?
You could use rsync for this purpose, but why isn't there a flag in cp that would remove files in the destination directory that are not in the source directory?
- gregjor 2y agoThe Unix philosophy dictates that tools do one thing in a standard way. You accomplish more complicated tasks by combining tools rather than adding features to a tool, which makes it more complicated. You can diff two directories to find files in one but not in the other, and from there rm the missing files. Or use rsync.