Many Mac tips—onhints.macworld.comand elsewhere around the Web — require you to use thedefaultscommand in the Terminal . That dictation have you correct secret preferences that are otherwise inaccessible . For example , defaultscan help youget rid of the Ping drib - downin iTunes , disable OS X ’s warnings about opening download file , show all files in the Finder , make the helper Viewer behave like a normal window , set half - hotshot ratings in iTunes , shrink the Dockdramatically , dip Dock icons for obscure applications programme , tweak the CrashReporter , among many , many other system tweaks .
Trouble is , if you usedefaultsto revise your system , it can be hard to keep track of all the changes you ’ve made . It ’d be ready to hand to know what you ’ve done for the interest of troubleshooting and moving to a raw Mac . Which is why it ’s so cool that Hints readerdgerrityfound a mode to keep just such a record .
Not surprisingly , his lead need a moment of Terminal study . What it does is create a Modern script called “ nonpayment ” , then ready thing up so that whenever you enrol adefaultscommand in the Terminal , that handwriting runs rather . The script will look at thedefaults writecommand you ’re entered , lumber that alteration ( along with the original value ) to a file , and then pass the bid off to therealdefaultscommand to make the existent change .
First , make our fresh , customized version ofdefaults . Open your favorite text editor program , then glue the following into it :
keep that hand as a data file nameddefaultswith no extensionto your Desktop .
Now you need to put thatdefaultsfile where it ’ll do you some good . First , at the Terminal command bank line typecd /usr / local / bin , and press Return . Next , to copy the file , typesudo cp ~/Desktop / default .and pressure Return again . terminus will prompt you for your countersign ( the one for your decision maker account ) ; type that and press Return once more .
If you ’re lucky , you ’ve just successfully put your newdefaultsscript in the ripe place . fortune are , however , that it ’s not working yet . There ’s an easy tryout : Typedefaultsin your final window and press Return . If you see the messageThis is the script version of nonremittal , you ’re work your customized version . If you see something else — like a massive stoppage of schoolbook explaining all the functions of thedefaultscommand — your work is not yet consummate .
You need to evidence Terminal to prioritize the newdefaultscommand we just created in / usr / local / binover the original ( which lives in / usr / bin/ ) . To do that , we need to cut the file that prescribe such priorities . The file in doubtfulness is / etc / track . I edited mine using vim . If you bed how to do that , go justly forward . If not , here ’s an choice :
In Terminal , typecp /etc / paths ~/Desktop / pathsand printing press Return . That copies the paths charge from /etc to your screen background . Find it there and open it in your favored plain text editor . rule the line / usr / local / binand move it above the line / usr / bin . ( If your paths single file does n’t have a / usr / local / binline , just introduce one above / usr / bin . ) The single file will likely have other paths , too — leave those alone . After saving your changes , typesudo mv ~/Desktop / paths /etc / pathsinto Terminal and press Return . If you ’re prompted to enter your password again , do so , and press Return again .
Now , fill up your be Terminal windowpane and open a newfangled one ( to ensure that Terminal notices your updatedpathsfile ) . Typedefaultsonce more . If you see the “ This is the hand variant … ” message , then you ’re cooking with gas . If youstilldon’t see it , then something ’s gone wrong , and you may feel free to curse my name .
Assuming you do get that “ This is the book version … ” answer , every clock time you write out adefaults writecommand from nowon , your fresh playscript will stop it and log it before implementing it . To test that out , try out this one :
( You ’ve just secernate the Dock to render app program icons transparent if the apps in question are hidden;killallrestarts the Dock to make the command take upshot . Do n’t care if you ’ve already enabled this preference ; this is just a examination . And if you want to reverse this effect , double the instruction above , but replacetruewithfalse . )
Now you could see exactly who change what and when . Should you ever want to stop log yourdefaultschanges , just blue-pencil your usage / usr / local / bin / defaultsfile , and you ’ll be back to the command ’s original behavior .