0

If I wanted to get rid of everyone on my computer and I just typed in the following into the terminal:

sudo rm -rPf --no-preserve-root

would that work or is something wrong with my syntax? I added --no-preserve-root because I want it to get everything and I read that rm -r doesn't work by itself if no directory is specified

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
Danny3344
  • 1
  • 1
  • 2
    Possible duplicate of [Is there a scenario where rm -rf -no-preserve-root is needed?](http://superuser.com/questions/742334/is-there-a-scenario-where-rm-rf-no-preserve-root-is-needed) – DavidPostill Nov 28 '16 at 18:21
  • `--no-preserve-root` This option is not recommended unless you really want to remove all the files on your computer. – DavidPostill Nov 28 '16 at 18:22
  • This command is missing a path, but it will most certainly get rid of every*thing*, but most certainly not every*one* currently logged on. – Daniel B Nov 28 '16 at 18:27
  • Second to what Daniel B said – please clarify whether you are looking to get rid of everyTHING or everyONE. – seagull Nov 28 '16 at 18:35
  • I want to get rid of absolutely everything – Danny3344 Nov 28 '16 at 19:13

1 Answers1

0

sudo rm -rf will get rid of any file or folder that you feed to it (unless it is a file protected by the system-integrity system of OSX). -P will overwrite the empty space, but I would not advise using it if you have an SSD as it will only reduce the lifespan of it.

As to your question: do you want to get rid of all accounts? Or Simply everything? Because all I can tell you is that as far as I am aware your proposal or a equivalent like sudo rm -rfP / will certainly ruin your entire system.

I'd say, go for a clean install via OS Recovery if you want to start over with a fresh install. If you only want to delete the accounts, use the appropriate settings in 'System Preferences'.

Montmons
  • 103
  • 6