Get homebrew and have it install the core utilities. You can then see if the GNU version of cp supports the flags you desire. Here is a good answer on a partner site and I'll excerpt the exact steps you'll need to have cp be replaced by the GNU version if you wish:
Here's homebrew - Link
Here's the long story - https://superuser.com/questions/476575/replace-os-xs-shell-commands-with-the-linux-versions/476594#476594
An example of such an environment is Homebrew which for example has GNU sed
among other things. Once you've installed Homebrew, you can type
brew install coreutils
and install the GNU Coreutils. These will provide you with sed
, date
, printf
, wc
and many other tools that ship with GNU/Linux, but not OS X. However, so as not to "override" default OS X binaries, they will be prefixed with g
by default. So, after installing the Coreutils, if you want to use GNU sed, type
gsed
If this is too much of a hassle to type every time, you can add a "gnubin" directory to your PATH and just call GNU sed with sed
. You will need to add the following to your ~/.bash_profile
:
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
brew install coreutils findutils gnu-sed gawk
. See apple.stackexchange.com/questions/69223/….gcp
to avoid confusion) doesn't know how to copy the complex metadata that OS X files can have (extended attrs, etc); so if you usegcp
on an alias file, the copy will be missing critical info and will not work.gcp -R
will copy it along with everything else). If you mean._somefilename
, that's an AppleDouble file used to store metadata (the info I'm talking about) on some kinds of foreign volumes, which is ... complicated...