Wednesday, March 20, 2019

Copy file preserving directory structure in Linux

Use cp --parents /d1/d2/d3/f4 /e1/e2/e3 to get the copy /e1/e2/e3/d1/d2/d3/f4.

[Courtesy: this]