I find myself doing this often enough that I wonder if there's a standard Unix way to do it:
% mkdir -p /TARGETDIR/relative/path/to % cp ./relative/path/to/somefile /TARGETDIR/relative/path/to
In other words, I don't want to just copy
/TARGETDIR, but actually I want to copy its entire relative path.
Is there a simpler way to do this than the two-liner above?