4 ms·
I always thought dd stood for disk destroyer, only ever used it for making low level copies of whole disks or shredding them with if=/dev/random. This thread ha
by gfody 10y ago
I always thought dd stood for disk destroyer, only ever used it for making low level copies of whole disks or shredding them with if=/dev/random. This thread has been informative and terrifying as I learn cat and cp are every bit as dangerous as dd! I never would expect something like cp xxx /dev/sda to actually work. Thinking about it, why should cp even support something like that? I'll copy files but I'll also DESTROY YOUR SHIT if you say so?
- dec0dedab0de 10y agoI'll also DESTROY YOUR SHIT if you say so? It better :-) But it all comes from the unix idea of everything is a file.
- luca_ing 10y ago> I never would expect something like cp xxx /dev/sda to actually work. Thinking about it, why should cp even support something like that? I'll copy files but I'll also DESTROY YOUR SHIT if you say so? That's the beauty of Unix. Everything is a file. Thus every program that can work with files, can in fact work with everything. It's actually very liberating.
- angry_octet 10y agoIt isn't the same though, because not all files are non-seekable streams of bytes. In fact, most are seekable and possibly sparse. What happens when you did a sparse file? And cp? https://wiki.archlinux.org/index.php/sparse_file https://wiki.archlinux.org/index.php/sparse_file C.f. fallocate(1,2)
- krylon 10y ago> I'll also DESTROY YOUR SHIT if you say so That's the Unix way: The customer, eh, user is always right. I once wanted to clean up backup files created by emacs (they end in the tilde character) by typing "rm <asterisk>~" - except what I did type was "rm <asterisk> ~". (On the upside, I learned a valuable lesson that day.)
- yjftsjthsd-h 10y ago1. Everything is a file; why would cp care that one file happens to be your hard drive? 2. "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn