MacOS – Using command line how to open a specific section of GUI System Preferences

command linemacosterminal

It is possible to open a specific section (sub section) of the GUI System Preferences via command line terminal?

Example:
If I want to open just the main System Preferences window, I just run open /Applications/System\ Preferences.app/ but what about (for example) I want to open the System Preferences > Security and Privacy section?

Thank you so much in advance for your help.

Best Answer

You have to know where the actual PreferencePane resides. Just supply the full path to the section you want.

For Apple supplied PreferencePanes it's easy:

open /System/Library/PreferencePanes/Security.prefPane

opens your desired System Preferences > Security and Privacy.

Other preferencePanes might be found at /Library/PreferencePanes or ~/Library/PreferencePanes