How to View & Clear the Mac NVRAM Contents from Terminal in OS X

Dec 16, 2015 - 3 Comments

Terminal in OS X Advanced Mac users may find it necessary to view or directly manipulate firmware variables found within NVRAM on the computer. Typically the NVRAM contains specific system data about things like the system audio level, startup disk details, an active user name, screen backlighting and resolution, and other technical details. While most users have no business interacting with NVRAM, there are times when manually viewing and clearing out NVRAM variables can be beneficial for troubleshooting purposes.

With the help of a command line tool in OS X, Mac users can directly read and adjust firmware in OS X without having to reboot the Mac and performing a general NVRAM reset.


This probably goes without saying, but aside from listing the nvram contents, users should absolutely not delete or clear nvram variables if they don’t know exactly what they’re doing and why.

To get started, launch the Terminal, found in /Applications/Utilities/ and issue the following commands, depending on your desired objective:

How to View All NVRAM Contents on Current Mac

Issue the following command to print out all current NVRAM contents:

nvram -xp

This will display the output in XML format, which is much more readable than the default format, which is read with the -p flag:

nvram -p

If you don’t specify -x flag, you’ll likely see a lot of gibberish, XML, and perhaps some plain text mixed in that is easily readable, but for the most part this data is only going to be relevant to advanced Mac users for troubleshooting purposes.

An example of nvram -p output may look like the following:
$ nvram -p
efi-apple-payload-data %20%10%00%CC%00U%00P%00D%00A%20%10%00%CC%00U%00P%00D%00A%20%10%00%CC%00U%00P%00D%00A%20%00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A00U%00P%00D%00A
efi-boot-device IOMatchIOProviderClassIOMediaIOPropertyMatchUUIDBD2CB9D3-8A79-4E2F-94E2-C5EC9FEBBA64BLLastBSDNamedisk0s3%00
SystemAudioVolumeDB %00
prev-lang:kbd en:0

Again, this will be meaningless data to most users but advanced Mac users can find helpful details in the NVRAM if they know what to look for.

How to Clear All NVRAM from the Command Line in Mac OS X

The next most useful trick is to be able to clear out NVRAM with the same command string. To delete all nvram variables just use the following syntax:

nvram -c

For changes to take effect, you must reboot the Mac, thus unless you’re doing something else you may want to just initiate a reboot from the command line while you’re there.

Deleting Specific NVRAM Variables on Mac OS X

To be more specific, you can also target a set nvram variable for removal with the -d flag:

nvram -d (variable key name goes here)

For example, to clear the system audio setting from nvram:

nvram -d SystemAudioVolume

Going Further with nvram Modifications

The nvram command has other uses as well for advanced users, from settings like disabling the startup boot chime sound on a Mac to always booting into verbose mode in OS X or even enabling safe boot mode from the terminal for remote management or a headless/keyboardless Mac. For those interested in learning more about this powerful command, the man page for nvram is quite helpful, as is the basic –help flag to show other syntax options:

% nvram --help
nvram: (usage: no such option as --)
nvram [-x] [-p] [-f filename] [-d name] [-c] name[=value] ...
-x use XML format for printing or reading variables
(must appear before -p or -f)
-p print all firmware variables
-f set firmware variables from a text file
-d delete the named variable
-c delete all variables
name=value set named variable
name print variable
Note that arguments and options are executed in order.

Whether or not you find this necessary or easy really depends on your skill level and your needs. Many advanced Mac users know they can also reset the PRAM / NVRAM on boot with a key sequence, which can be helpful in troubleshooting some particular issues as well, and that approach removes everything from NVRAM similar to the -c flag during an actual reboot, which is perhaps easier for many users to remember. This is particularly valuable for working with remote machines connected through SSH or found elsewhere on the network, where it would be impossible to manually reset NVRAM with a keyboard shortcut sequence.

Another common example where clearing nvram can be beneficial for troubleshooting purposes is when the Mac App Store loads a blank display that won’t populate with any content or store data. For whatever reason, the nvram -c flag and rebooting almost always resolves that issue alone.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks, Troubleshooting

3 Comments

» Comments RSS Feed

  1. St13v13 says:

    How to stop (in Yosemite) prawlers or snoopers,
    I know somebody(s) knows every singel thing I type out
    on my Mac …. even what (occasional) movies I watch…

    Pitty, that I don’t know the first thing on how to rsolve that with a terminal code… could you help me with that please?

    And second: A good link to start learning and understanding, to eventually writing in the Terminal lingo…Pdf’s or whatever is the fastest for a dummy like me to understand&learn it…

    Kind regards.
    How do I know that there are peoples watching (maybe) and
    monitoring me on mt MAcBook Air activities?

    They told me as a joke, but after a few times, a coincidence
    was out of the question!..

    asap, please ,…lol!

  2. Fco sagasta says:

    hello, I have a big problem.

    I wrote in terminal “nvram -c” because I wanted to fix the fan velocity of my mac mini 3.1 (early 2009). Now the problem is the light in front of the mac mini does´t work and also the fan works from the beginning. Before I wrote in terminal I could configure the fan speed with fan control app, but now this program can’t detect that exists a fan.

    What can I do? is it possible to reverse the situation? if I change the battery inside the mac mini is possible to fix it?

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates