Jump to content

Recommended Posts

Posted

<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/defaults-history.jpg" alt="defaults history" title="defaults-history" width="620" height="254" class="aligncenter size-full wp-image-26636" /></p>

<p>It’s easy to lose track of all the defaults commands used to perform tweaks to Mac OS X, but with the help of the history command it’s easy to list every <a href="http://osxdaily.com/tag/defaults-write/">defaults write</a> and accompanying defaults delete commands ever used on a Mac. Launch the Terminal to get started.</p>

<h2 style="font-size:1.2em;">See All Defaults Commands Executed</h2>

<p>To see all defaults commands, including defaults write, defaults read, defaults delete, and even those requiring sudo:</p>

<p><code>history |grep "defaults"</code></p>

<p>Will return something like this:</p>

<p><code style="font-size:95%;"> 47 sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName

48 sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo IPaddress

98 defaults write com.apple.DiskUtility DUDebugMenuEnabled 1

206 defaults write com.apple.Safari IncludeInternalDebugMenu 1

237 defaults write com.apple.dock itunes-notifications -bool TRUE;killall Dock

238 defaults delete com.apple.dock itunes-notifications

239 defaults write com.apple.dock desktop-picture-show-debug-text -bool TRUE;

241 defaults delete com.apple.dock desktop-picture-show-debug-text;killall Dock</code></p>

<h2 style="font-size:1.2em;">See Only Defaults Write Commands</h2>

<p>To see only defaults write commands, including those requiring sudo:</p>

<p><code>history |grep "defaults write"</code></p>

<p>The results will look the same as above, but without showing any defaults read or defaults delete commands.</p>

<h2 style="font-size:1.2em;">See Only Defaults Delete Commands</h2>

<p>To see which defaults write commands have been reverted, grep for ‘delete’ rather than ‘write’:</p>

<p><code>history |grep "defaults delete"</code></p>

<h2 style="font-size:1.2em;">See Defaults Commands Related to Specific App</h2>

<p>By changing the text within grep to an application or process name, we can see which defaults commands were used only for that specific application. For example, to see only defaults commands that impacted the Finder:</p>

<p><code>history |grep "defaults write com.apple.finder"</code></p>

<p>Most apps are easy to find this way, and the default applications in OS X almost always follow the ‘com.apple.appname’ convention.</p>

<p>We touched on this concept before in a <a href="http://osxdaily.com/2011/02/06/print-and-query-command-history-to-find-past-commands/">past post about the history command</a>, but focusing on defaults commands is useful enough to deserve individual recognition. </p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/IacsyrX-K7KhZwC5BppWBfktZd8/0/da"><img src="http://feedads.g.doubleclick.net/~a/IacsyrX-K7KhZwC5BppWBfktZd8/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/IacsyrX-K7KhZwC5BppWBfktZd8/1/da"><img src="http://feedads.g.doubleclick.net/~a/IacsyrX-K7KhZwC5BppWBfktZd8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=nrstyFgIlww:zBYKQydzvnk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=nrstyFgIlww:zBYKQydzvnk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=nrstyFgIlww:zBYKQydzvnk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=nrstyFgIlww:zBYKQydzvnk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=nrstyFgIlww:zBYKQydzvnk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=nrstyFgIlww:zBYKQydzvnk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=nrstyFgIlww:zBYKQydzvnk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a>

</div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/nrstyFgIlww" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic


×
×
  • Create New...