Skip to content

nvram MacOS Command Guide

The MacOS nvram command allows users to interact with the system’s Non-Volatile Random-Access Memory (NVRAM) variables. NVRAM is a small amount of memory that stores system settings even when the computer is turned off. With the nvram command, you can view, set, and delete these variables, which can be useful for troubleshooting system issues, changing startup disk preferences, or modifying system configurations. By using the nvram command in the Terminal, you can access and manipulate these NVRAM variables to customize your MacOS operating system.

nvram Syntax:

Terminal window
nvram [options] [parameters]

Options:

OptionDescription
-cClear all settings in NVRAM
-dDelete a variable from NVRAM
-pPrint all variables in NVRAM
-xPrint all variables in XML format

Parameters:

ParameterDescription
variableName of the variable to delete or view
name=valueSet the value of the specified variable

nvram Command Samples:

Display all NVRAM variables

Terminal window
nvram -p

This command displays all NVRAM variables currently set on the system.

Set a specific NVRAM variable

Terminal window
nvram my_variable="example value"

This command sets a specific NVRAM variable with the value “example value”.

Delete a specific NVRAM variable

Terminal window
nvram -d my_variable

This command deletes a specific NVRAM variable named “my_variable”.

Reset NVRAM to default settings

Terminal window
nvram -c

This command resets the NVRAM to its default settings.

View a specific NVRAM variable value

Terminal window
nvram my_variable

This command displays the value of a specific NVRAM variable named “my_variable”.

Clear all NVRAM variables

Terminal window
nvram -c

This command clears all NVRAM variables currently set on the system.

Enable verbose mode for NVRAM operation

Terminal window
nvram -x

This command enables verbose mode for NVRAM operation, providing more detailed information.

How can I display all the NVRAM variables set in MacOS?

To display all the NVRAM variables set in MacOS, you can use the following command:

Terminal window
nvram -p

How do I set a new variable with a value using nvram in MacOS?

To set a new variable with a value using nvram in MacOS, you can execute the following command:

Terminal window
sudo nvram my_variable="my_value"

How can I delete a specific NVRAM variable in MacOS using nvram?

To delete a specific NVRAM variable in MacOS using nvram, you can run the following command:

Terminal window
sudo nvram -d my_variable

How can I reset the entire NVRAM to default values in MacOS?

To reset the entire NVRAM to default values in MacOS, you can use the following command:

Terminal window
sudo nvram -c

How do I set the boot-args variable in MacOS using nvram?

To set the boot-args variable in MacOS using nvram, you can run the following command:

Terminal window
sudo nvram boot-args="-v"

How can I enable verbose mode during boot using nvram in MacOS?

To enable verbose mode during boot using nvram in MacOS, enter the following command:

Terminal window
sudo nvram boot-args="-v"

Applications of the nvram command

  • Storing non-volatile random-access memory variables.
  • Reading firmware variables.
  • Setting firmware variables.
  • Inspecting firmware variables.
  • Modifying firmware variables.
  • Resetting firmware variables to default values.