Add option to create directories/sub-directories as needed when using `cp`
Author: r3dArchCreated Sep 8, 2026Updated Sep 10, 2026
Labelscategory:enhancementstatus:needs-triage
Basics
- I have done a basic search through the issue tracker to find similar or related issues.
- I have made myself familiar with the available features of Nushell for the particular area this enhancement request touches.
Related problem
I recently wrote a one-liner to copy all photos/videos from a directory based on mime type to a different directory and wanted to preserve the directory structure, but since the destination did not have the sub-directories cp failed. I ended up using mkdir with path dirname, which works, but is a little convoluted.
Describe the solution you'd like
I am still pretty new to nushell, so perhaps there is a better way already, but otherwise I think cp should have an option to create directories as needed or maybe just make them by default as mkdir does. I can try to implement this feature if it is wanted and once a decision is made as to which solution is best.
Describe alternatives you've considered
No response
Additional context and details
No response
Source: nushell/nushell