SpaceCadet

joined 2 years ago
[–] SpaceCadet 2 points 10 months ago* (last edited 10 months ago)

The flag is called --no-preserve-root, but the flag wouldn't do anything here because you're not deleting root (/), you're deleting all non-hidden files and directories under root (/*), and rm will just let you do it.

[–] SpaceCadet 3 points 10 months ago (1 children)

It’s apparently a hobby and to be competitive, you need to be able to spew bullshit at amazing rates. Personally I’ve maxed out at 140 wpm

I'm limited by the rate at which I can think of bullshit.

[–] SpaceCadet 4 points 10 months ago (5 children)

yet all I needed is a "this side up" symbol ...

[–] SpaceCadet 4 points 10 months ago (3 children)

Since you forgot to add - - preserve-root It won’t go too far

Go on then ... try it.

Or don't because you will erase your system. (Hint: it's in the asterisk)

[–] SpaceCadet 1 points 10 months ago

as the binary is already loaded into memory

That’s not the reason why it continues. It’s because there’s still a file descriptor open to rm.

[–] SpaceCadet 1 points 10 months ago* (last edited 10 months ago)

That’s not the reason why it continues. It’s because there’s still a file descriptor open to rm.

[–] SpaceCadet 17 points 10 months ago* (last edited 10 months ago)

In Unix/Linux, a removed file only disappears when the last file descriptor to it is gone. As long as the file /usr/bin/rm is still opened by a process (and it is, because it is running) it will not actually be deleted from disk from the perspective of that process.

This also why removing a log file that's actively being written to doesn't clear up filesystem space, and why it's more effective to truncate it instead. ( e.g. Run > /var/log/myhugeactivelogfile.log instead of rm /var/log/myhugeactivelogfile.log), or why Linux can upgrade a package that's currently running and the running process will just keep chugging along as the old version, until restarted.

Sometimes you can even use this to recover an accidentally deleted file, if it's still held open in a process. You can go to /proc/$PID/fd, where $PID is the process ID of the process holding the file open, and find all the file descriptors it has in use, and then copy the lost content from there.

[–] SpaceCadet 1 points 10 months ago* (last edited 10 months ago) (1 children)
[–] SpaceCadet 0 points 10 months ago
[–] SpaceCadet 1 points 10 months ago* (last edited 10 months ago)

Leave the poor kernel out of it, it has nothing to do with this. It's Lennart, not Linus.

[–] SpaceCadet 7 points 10 months ago* (last edited 10 months ago)

No can do, you just pressed Z after the UNDOs

Like a time traveller who accidentally steps on a butterfly and erases the whole future that he came from

[–] SpaceCadet 2 points 10 months ago (1 children)

I don't think it's intended as a "solution", it just lets the clobbering that is caused by the case insensitiveness happen.

So git just goes:

  • checkout content of README.md to README.md (OS creates README.md)
  • checkout content of README.MD to README.MD (OS overwrites README.md)

If you add a third or fourth file ... it would just continue, and file gets checked out first gets the filename and whichever file gets checked out last, gets the content.

view more: ‹ prev next ›