Posts

Showing posts from February, 2018

TIL: Keeping parent directory structure while copying

There had been instances when I wanted to copy "/home/roy" to a target directory "/target" as "/target/home/roy". I used to do some scripting foo to get this done. A few days back, I learned this cool option called "--parents" in cp command that will preserve the parent directory structure while copying. Made my life a lot easier on one of my backup tasks.