0

Note: Don't type rm or any variation of it into terminal under any circumstances if you are not experienced with the command line

Does the Mac OS X block you from using rm in those directories to delete a user or delete all the users and do you need to use sudo and put in an administrator password or does it let you without any passwords?

For example if you typed in the following line into terminal would it just completely wipe everything?

cd /Users; echo rm -rf *

Of course the echo wouldn't be used if you actually wanted the remove command to run.

migrated from stackoverflow.com Apr 3 '16 at 16:53

This question came from our site for professional and enthusiast programmers.

1

Two cases:

  • you're logged in as root. Everything goes away.
  • you're logged in as a normal user. All of that user's files go away.

In some systems, rm is supposed to prompt you if you do this at the "/" level. Do not count on that prompt.

With El Capitan, Apple supplies a "prompt" per se, which by default should leave enough of the operating system to boot and recover from your backups. To see if this has not been disabled, use

csrutil status

Further reading:

  • This is mostly incorrect - SIP doesn't protect anything in /Users - only normal ACL and filesystem separations exist in that part of the filesystem. – bmike Apr 3 '16 at 16:56
  • 1
    You can recover the system if your home directory was erased (a little painful, of course). – Thomas Dickey Apr 3 '16 at 16:59
  • Also - please note - the question did have rm -rf / in the body so this question was addressing that aspect before being migrated here. We cover rm at the root already at apple.stackexchange.com/questions/174595/… – bmike Apr 3 '16 at 17:06
  • I've had this conversation before, where it turned out that a minor change of command was sufficient to bypass the prompt. – Thomas Dickey Apr 3 '16 at 17:09
0

Yes it will wipe everything and it wont work without the sudo privileges; You can try it in a virtual environment or you can take a look at this https://www.youtube.com/watch?v=D4fzInlyYQo Have a nice Day !

You must log in to answer this question.