4 Awesome Terminal Tricks to Tweak Your Desktop
Terminal’s Unix-style command-line interface may be serious business, but that doesn’t mean you can’t use it for a little monkey business, too. These Terminal tricks show you some interesting tweaks you probably haven’t imagined before, and to save you the pain of meticulously typing in all these commands, you can copy/paste them.
1. Make Your Screensaver the Desktop Background

You know that screensaver, right? Now it’s your wallpaper! Whoa. Trippy.
If you have a nice-looking screensaver like us, you want to see it all the time. Type the command below in Terminal, and your current screensaver will appear as your Desktop’s background image. Then, as with all commands on this page and the next, hit Return.
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &
Simple? Check. Fun? Totally. But if you get motion sickness, simply close the Terminal window to return your Desktop to normal.
2. Re-Index Spotlight

If Spotlight’s acting funky, re-indexing will get it up on the right side of the bed.
Spotlight search results not appearing as they should? Force Spotlight to re-index itself with the following two commands:
sudo mdutil -E /
sudo mdutil -i on /
You’ll be prompted for your administrator password. Then, after a few minutes’ delay, Spotlight will begin re-indexing your Mac.
3. Put Spacers in your Dock to Organize Apps
![]()
Here’s Cory’s impressively crowded Dock before he added spacers...
![]()
...and afterward, those lovely little gaps create logical groupings of kinds of apps.
The Dock is a great place for your most-used applications, but it can get a little crowded. With a Terminal command, you can add spacers to your Dock to organize things a little better. Open Terminal (Applications > Utilities), then type the following command:
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
Type the command once for each space you’d like to add, then type the following to restart the Dock:
killall Dock
In the new Dock, you’ll see the spacers to the right of your applications. Drag spacers around to create “sections” of applications in your Dock. To remove a spacer, simply drag it off the Dock.
4. Create a Recent Items Stack in the Dock

Stacks let you quickly access data from your Dock, but Apple doesn’t let you add a stack containing your most recently accessed files or apps unless you use the following Terminal command:
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
Then restart the Dock:
killall Dock
When the Dock reappears, you’ll find a stack of recent items beside the Trash. To change which items appear in the stack, right-click it to choose Recent Applications, Recent Documents, Recent Servers, Favorite Volumes, or Favorite Items.
Update: We have had some reports of a few users' Docks disappearing and not returning after running the Recent Stacks command in an earlier version of this article. (We had it formatted incorrectly earlier, but it's been fixed.) If this happened to you, the easiest fix is to delete the com.apple.dock.plist and com.apple.dock.db files in ~/Library/Preferences. When you do this and restart, your Dock should return in pristine condition. Remember, this is only for users whose Docks failed to open after restarting their Mac.

revsheila
March 17, 2011 at 12:23am
I used all but the first terminal trick and they all worked first time. I love the 'cut and paste' feature offered on the website as it eliminates the errors that result from trying to type in gobbeldy-gook.
Thanks.
anonymoususer
January 31, 2011 at 9:15pm
When I did this, I realized, hey, there has to be a simpler way. That's why I turned to automator to create an applications that runs the screensaver command without copying and pasting the command each time. So, I created a script that ran the command. Then I realized, to quit it, I needed to go to Activity Monitor to kill ScreensaverEngine to stop it. Then I decided, back to Automator, and I created the script with the unix command "killall ScreenSaverEngine"... So now, in my dock, I have an app to start it without the command madness, and when I want to recover from motion sickness, I click the killall app.
ktab27
January 24, 2011 at 8:55am
I have tried typing the instructions, then I tried pasting them. Finally by pasting the formula and hitting return each time then pasting in the "kill command" and again hitting return, I found a number of spaces next to the terminal icon all the way on the right of the dock. But couldn't move them to any other location. Finally I discovered you could quit them, and I got rid of them. Tried several times - spent more than 15 minutes. Didn't work for me.
sarinestephen
January 08, 2011 at 7:43pm
I just tried #4 and after typing killall Dock my dock disappeared and never to return. I continuously get the pinwheel and my computer freezes, not allowing me to run anything. Help please!
dunkinn
January 13, 2011 at 10:40am
yes... me too. i was able to restore things by first, logging in w/ a safe boot, and then, deleting 2 dock preference files. this restored my dock to default settings, and my laptop was up and running well again. I'll provide details here:
1. safeboot- start computer and wait for the start up tone. immediately after the tone, hold down the shift key. release shift key when the grey apple icon appears. allow the system to boot (you'll notice a time line indicating how long it will take). after a few minutes you should see a safe boot login screen. log in.
2. preferences- once you are logged in, don't try to do too much, like browse the internet, or check for the dock, etc, your computer may freeze once again. Instead, just go to home-library-preferences, and trash the following files:
com.apple.dock.plist
com.apple.dock.dbhope that works for you!
EBdarci
June 08, 2011 at 5:09pm
I deleted the files first and then restarted in safemode, i didn't see your comment until after the update from the post to delete those files....but nothing happens, can you help me please? T__T
Roberto Baldwin
January 04, 2011 at 5:55pm
Hi all,
Sorry about the CMS introducing odd quotes. The problem has been fixed and you can copy and paste directly from the site now.
-Robbie
markf21
January 04, 2011 at 5:39pm
Spacing in the Dock can also be created using Deeper found at http://www.titanium.free.fr/
Deeper gives you the choice of creating spaces between Applications (which will place the space at the far right each time (or bottom depending on Dock orientation) and then you can drag the space where you'd like it). Each space has to be created and then dragged to where you'd like it. Spaces can also be added in the Documents section (to the right (or bottom) of the Crosswalk spacer the same way.
Deeper has many additional tricks it can perform also! Just a happy user and not affiliated in any way!
matthew12
January 04, 2011 at 5:30pm
How about this for the Dock: You can make your app icons transparent when they're hidden. It makes it easier to identify which ones are hidden (and running). Type this into Terminal with out the : symbol and quotation marks
Step 1: "defaults write com.apple.Dock showhidden -bool YES"
Step 2: "killall Dock"
Undo: "defaults write com.apple.Dock showhidden -bool NO"
MatthewF
January 04, 2011 at 2:47pm
The CMS software here is converting single- and double-quotes to their curly alternates. Looks nice, ruins the commands. Copy and paste these instead (I put "code" tags around the the commands in my comment here):
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
liebowriter
January 08, 2011 at 8:34am
I seem to be the only one who keeps getting error messages...
BigChiefS4
January 04, 2011 at 2:29pm
Don't copy and paste. It's adding extra spaces. If you type it out exactly as it is above, it will work.
bensen
January 04, 2011 at 12:44pm
dock spacer doesnt work
thats the right one
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
liebowriter
January 08, 2011 at 8:30am
Wait, I still get an error message telling me it can't parse the information.
ScripTeach
January 04, 2011 at 12:27pm
Tried to #4, create a Recent Stack, but got this when ran command:
-bash: syntax error near unexpected token `}'
Maybe it's because I'm copying and pasting?




















