How to reset mac PRAM through the command line in Lion/Mountain Lion?

9

1

I'm trying to write a script to automate a PRAM reset and I've seen a lot of old guides that tell me to use the following command to reset the Mac's PRAM via the terminal:

nvram boot-args="-p -r"

But this command doesn't seem to work anymore, at least not on any of the computers I've tried it on. I'm trying to find a more up-to-date list of available boot-args and I was able to find this question about boot-args strings but there doesn't seem to be anything in there or any of the links about resetting the pram.

Any ideas?

Alex Plumb

Posted 2013-01-03T15:16:10.300

Reputation: 1 616

Answers

6

Mountain Lion does not have this functionality, but Mavericks does!

Resetting the PRAM is now as simple as running the following command as root:

nvram -c

According to the man page for the nvram command (in Mavericks):

-c     Delete all of the firmware variables.

I should note that this also works all the way up to and including Sierra.

Alex Plumb

Posted 2013-01-03T15:16:10.300

Reputation: 1 616

-1

  1. You have to be logged-in as an administrator.
  2. You must use "sudo" before the "nvram" command if you do this in the terminal.

Thomas Thaler

Posted 2013-01-03T15:16:10.300

Reputation: 1

-3

I found the Apple article for Mountain Lion, the process seems to be quite simple. Link here: KB PH11243

  1. Shut down the Mac.
  2. Find the Command, Option, P & R keys.
  3. Turn on the power, then hold these keys down. Ensure that the keys are held down until the second boot sound plays.
  4. Release the keys.

James Dietz

Posted 2013-01-03T15:16:10.300

Reputation: 10

1The user wants to write a script to automate this from a shell in a running system, not doing it by rebooting. – slhck – 2013-01-21T22:03:46.273