Alternative to cp --parents in terminal I was trying to use the --parents option with cp (to create the non-existing directories in the target path) in the terminal but that option does not seem to be working in MacOS.  

&gt;cp --parents src_dir trgt_dir
cp: illegal option -- -
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory


Any alternative?
rsync -R (--relative) is like cp --parents. So rsync -rR a/b c copies to c/a/b instead of c/b.

Or just install the GNU cp with brew install coreutils or sudo port install coreutils and use gcp -r --parents a/b c.