If I make a change to a plist file, how can I subsequently force a refresh so that it is reflected? Do I need to logout and log back in, or can I run a command?
1 Answer
The .plist
has to be re-read. To do that, you have to restart the service or application that utilizes it.
For example, if you make one of the many, many changes in Finder, you need to issue the command killall Finder
which will terminate all Finder processes and it will automatically restart.
Some apps can be closed via the GUI and system processes are usually killed off via command line though Activity Monitor does give you the ability to do the same thing. If they are not automatically restarted, you'll have to manually start them.
-
On Linux/BSD, I can do kill -HUP <PID> to force the process to reload the configuration. Would that also work?– John DoeCommented Aug 19, 2023 at 14:41
-
Yes, you can do the exact same thing in macOS.
HUP
sends the "hangup" signal. It's the same signal that gets generated if you are running a process in the foreground and then disconnect your terminal (which is why you can execute a process withNOHUP
). Whether or not the process respawns depends on if there's a helper running to do so; you may still have to relaunch it manually.– AllanCommented Aug 19, 2023 at 14:46
defaults write
command is for.