10

Just learned about /dev/null
Would mv / /dev/null work?

Comments
  • 5
    You can't move a parent directory to one of its children.
  • 18
    @lucaspar Not with that attitude.
  • 2
    Also, you can't move a regular file or directory to a device node.

    (Plus, I'm not really sure that the system would let you move the root directory just like that.)
  • 1
    @lucaspar @ethernetzero :/ well I think sudo rm -rf / does the job then...
  • 3
    What about mv /dev/sda /dev/null
  • 0
    @A-C-E that should work.
  • 0
    @A-C-E actually the opposite should work. like cp /dev/null /dev/sda? not sure tho
  • 3
    @A-C-E @gitreflog

    cat /dev/null > /dev/sda

    That would probably work better, that is, as long as you actually have a disk in /dev/sda.
  • 1
    @ethernetzero ah yeah, thats right!
  • 0
    @ethernetzero isn’t that usually the disk you are booted off of?
  • 0
    @A-C-E Not necessarily always. The disk could have a different interface or even be named differently for whatever reason, so there can be cases where you don't have anything in /dev/sd*.
  • 0
    @A-C-E what's /dev/sda
  • 1
    @bcye In a Linux system, a long time ago when there were SCSI disks and IDE disks, SCSI disks were named as /dev/sd* while IDE disks were named /dev/hd*.

    When Serial ATA disks came out, they decided that, since the SCSI emulation drivers worked well for a wide range of disk interfaces, they might as well use the same interface for all hard disks, even for optical drives and such. So they started using the /dev/sd* naming for all hard disks. However, there are things like RAID controllers and the like that don't use the same generic driver, so the naming is usually different in those cases.
  • 2
    @Batburger Fuck I just giggled out loud at 2 am xD
  • 1
    @Batburger Ohhhhhh snap!!!!
  • 0
    Cat /dev/random > /dev/sda
  • 1
  • 0
    You need to do cat /dev/null > /dev/hda on your machine!
    Yeah. Take that 😜
Add Comment