How to create the folders structure at destination on a file copying

bash
unix

(Dmitry Fedyuk) #1

Use the --parents option:

–parents
Create missing parent directories in the destination, if necessary, when copying to target directory, according to the pathname specified in source.

computerhope.com/unix/ucp.htm#options

Example

cp --parents update/app/code/Magento/Update/Status.php ../patch