Como posso usar o comando rm no bash shell em modo de administrador?
Example:
rm -rf --no-preserve-root C:/Windows/System32
AVISO: Não tente o seguinte.
Ao usar o bash no WLS, você precisa endereçar as unidades usando mount
points, então C:/
se torna /mnt/c/
.
No entanto, se você tentar executar o comando acima corrigido como descrito acima, você Destruirá o Windows .
While the command runs, you’ll start notice that Windows will revert to default program settings as applications and classic programs are fully or partially deleted from your system. You’ll also notice that customization such as themes and desktop backgrounds will start to drop out. If you haven’t realized it yet, your system is about to die.
Continue lendo para todos os detalhes sangrentos.
rm -rf /
no Windows Subsystem for Linux revela um conjunto de dentes nítidos
Don’t run any commands mentioned in this article. They’re intentionally very destructive for your Windows system.
I had a go at running
rm -rf --no-preserve-root "/mnt/c"
in the new Windows Subsystem for Linux. I knew I could interact with the full file system and modify and delete files, but I didn’t expect it to be as potent as it turned out to be.While the command runs, you’ll start notice that Windows will revert to default program settings as applications and classic programs are fully or partially deleted from your system. You’ll also notice that customization such as themes and desktop backgrounds will start to drop out. If you haven’t realized it yet, your system is about to die.
Like when you run this command under a full Linux kernel, the system will usually buckle before it manages to delete every file completely. Files currently loaded by the Windows kernel and files not writable by users in the Administrator user group in Windows will not be deleted. That, however, will still delete large chunks of critical system files and programs in Windows.
Running the above command will delete some 12 000 files in the default Windows installation directory at C:Windows as well as all user files in C:Users and leave your system incapable of booting up again! While you can still carry on working in the session for quite some time, it will eventually stop responding and throw you into a blue screen. Upon restarting, Windows will be missing drivers and other required files.
Running
rm -rf --no-preserve-root "/"
will only destroy your installation of the Windows Subsystem for Linux. Runninglxrun.exe /uninstall /full /y && lxrun.exe /install /y
in the Command Prompt will reinstall it and have you back up and running in Ubuntu in no time. It will not traverse the symlink to the Windows file system in the mount point and start deleting things on your C: drive. Doing so explicitly with the first command I mentioned, will not stop you from gutting your system.
Fonte rm -rf / no Windows Subsystem para Linux revela um conjunto de dentes nítidos