Linux: copy and create destination dir if it does not exist

mkdir -p "$d" && cp file "$d"

(there’s no such option for cp).

Leave a Comment