-4

Is there a command in Linux that removes everything that is loaded in the RAM including the kernel itself while the OS is up and running?

  • 4
    The kernel is the heart of the operating system. See WikiPedia: Kernel. Removing it would render your OS unusable. What exactly is going on that makes you think you need to remove the kernel? Update your question with more information, – eyoung100 Sep 28 '18 at 4:52
  • 1
    it is the shutdown command .... the computer cannot run without any program in memory – jsotola Sep 28 '18 at 7:11
  • @jsotola you should make that an answer. – roaima Sep 28 '18 at 7:20
  • I do know anything better than pulling the power cord or taking out the battery – Rui F Ribeiro Sep 28 '18 at 8:13
  • My professor has asked us a question in an assignment asking us to destroy the kernel so that the kernel malfunctions; therefore, the kernel will no longer provide service for the user. There is a command that you could run that would basically malfunction the kernel and freeze everything afterwards. After running the command and rebooting it (you have to reboot because nothing is responding), the OS won't load; as a result, you have destroyed the kernel. However, the key thing in my professor's question is that to write the command and destroy the kernel without rebooting it. – Danaz Sdiq Sep 28 '18 at 17:50
2

There is kexec to load a different kernel.

If you just want to remove everything without replacing it, that doesn't make sense. If you remove the kernel (and everything else), then the OS won't continue to run. You could as well use halt or poweroff.

  • Thank you. The reason why I want this is that my professor has asked us a question in an assignment asking us to destroy the kernel so that the kernel malfunctions; therefore, the kernel will no longer provide service for the user. There is a command that you could run that would basically malfunction the kernel and freeze everything afterwards. Check this video youtube.com/watch?v=Yh1XIHDl5NY However, the key thing in my professor's question is that to write the command and destroy the kernel without rebooting it. The command is ~$ sudo rm -rf / --no-preserve-root – Danaz Sdiq Sep 28 '18 at 17:59
  • I thought that since the kernel loads itself up in the RAM when you start the OS and you have the kernel in the hardware, you can then write a command that would combine the command I mentioned with a command for deleting everything in the RAM so that the system can then and only then malfunction without rebooting. Any thought? – Danaz Sdiq Sep 28 '18 at 18:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.