Monday, February 26, 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.

1 comment:

why do chia seeds gel said...

even though I've programmed, even in assembly code, and yes used bash, and linux etc in the past. I wound up deleting my virtual machine attempts as after all the thought that was put into getting DSL or any version working was complete, no one considered that someone might want to surf safely, get a file, then put that file in the host OS EASILY with no hassles. No hooking up two machines to network, or pen drives that don't show up etc. Someone who just wants to use linux that wants to move all their files around in that world is fine. But it shouldn't take more than 24 hours to figure out how to transfer a downloaded file through virtualbox to windows for example. And it's not about being "smart", otherwise they'd made you type a bunch of bash commands just to launch the games or pre-installed firefox. And you can resize the resolution, but then your usb mouse won't work... talking latest modern hardware here. idk, maybe it all works great on a 1992 computer. But I should be able to download a file, mount a usb thumb drive, tell it to move that file to the thumb drive, then lose scope and give mouse to host, then grab it. Better, are the menus that have host to machine, machine to host, and bi-directional. THEY SHOULD WORK!

SublimeText 3/Anaconda error

When I installed Anaconda manually by downloading and untarring the file (as given in the manual installation instructions here ), I got th...