Let's say I have a directory /data/something with the following subdirs:/data/something/iowa/data/something/wyoming/data/something/burkinafaso/data/something/sloveniaAll four subdirs have content. burkinafaso and slovenia are mount points; iowa and wyoming are not. I want to copy the directory structure in such a way that iowa and wyoming get copied recursively with all their subtrees, but burkinafaso and slovenia are copied as empty. cp doesn't seem to have such a switch, unlike du -x and find -xdev. What's the best way to do what I want?
Is there a variant of the cp -a command that avoids copying from other filesystems?
filesystems;cp;file copy
On a machine with the GNU Coreutils (most Linux distros), the cp command has -x.From cp man page:-x, --one-file-system