Customize Your Mac Using the Terminal

Apple includes a command line application, Terminal, that has many uses, most of which the common user will never need. However, for those willing to be a little bit adventurous with your Mac, there are some very handy tweaks and customizations you can make to your Mac by typing some simple commands into Terminal.

Steps

Open the Terminal

  1. Open the Finder.
  2. Click on "Applications" in the left-hand sidebar.
  3. Double-click on "Utilities".
  4. Double-click on the Terminal icon to open the application.

Learn how to use the Terminal

  1. To move the cursor, you need to use the left/right arrow keys on your keyboard (you can't use your mouse).
    • Your Terminal may look different. If you have not customized the settings, it will be black-on-white. To get a white-on-black terminal, go to Shell>New Window>Pro.
  2. To clear the Terminal screen, type clear.
    • You can retrieve previous commands entered in the Terminal by pressing the up/down arrow on your keyboard.
  3. If, for some reason, the Terminal freezes in the middle of executing a command, press control-c to exit the command.

Try some of the different tweaks in the Terminal

  1. Look through the tweaks listed in the section below and try out some of the ones you're interested in.
  2. To enable the tweak, copy and paste the command in the Terminal.
  3. If necessary, make alterations to the code.
  4. Press "return".
    • Each tweak includes code that will restart the Dock so the changes can take effect. The dock and desktop wallpaper temporarily disappearing is just the effect of re-launching the dock (indicated by killall Dock), which is necessary for the Terminal commands to take effect.

Hidden Games

  • Using a hidden-program called Emacs, your computer can perform a lot of simple video games and random functions!
  1. Open Terminal and type in ' emacs '. Press return. After that, a screen with a bunch of instructions should pop up. Instead, click ESC, then type in ' x '.
  2. Try typing in snake. A video game should show up! Here are come more functions/games: #*5x5 - fill in all the squares
    • animate - make text dance
    • blackbox - find objects by firing beams into a black box
    • Decipher Mode - help for cracking a simple alphabetic substitution cipher
    • Dissociated Press – fun with gibberish
    • Emacs Doctor - psychological help from a Rogerian analyst, for when it’s all getting too much for you
    • dunnet - text-mode dungeon adventure game
    • gomoku - five-in-a-row against the computer
    • Hanoi - computer solving the towers of Hanoi game
    • landmark - neural net robot that learns landmarks; in Emacs 24 it is invoked with landmark; in previous version it is invoked with lM
    • life - John Conway’s game of life
    • meese - stop impressionable young minds of America from seeing the etc/sex.6 man page
    • Morse Code - convert text to and from morse code
    • mpuz - multiplication puzzle (hidden digits)
    • pong - two-player computerized ping-pong
    • snake - guide a snake around the screen, eat to grow
    • solitaire - balls on an 8x8 cross shaped grid
    • studlify-region - convert text to study caps
    • Tetris Mode - arrange falling blocks
    • yow - random Zippy quote
    • Zone Mode - crazy screen effects when idle

Terminal Commands to Customize and Tweak your Mac

Show Hidden Files in the Finder

There are many files and folders on your computer that Apple purposely hides since the common user shouldn't need to access those files. However, sometimes you may want to view a hidden file or folder to perform less common tasks on your computer. To display hidden folders in your finder, enter the following command:

  • Important: For the command to take effect, you must restart the Finder:
    • Go to >Force Quit, then click on the Finder and "Relaunch"
  • To view the hidden files/folders, open and browse the Finder. You will notice that there are extra files/folders and that they are transparent.
  • Alter hidden files with caution. Some files can cause your Mac to work improperly if altered.
  • To remove the tweak, change "true" to "false"

Make Hidden Application Icons in the Dock Transparent

  • The following command will make dock application icons you hide transparent:

  • To hide an application, right-click on an open application in the dock and select "Hide"
  • To un-hide the application, right-click on the same icon and select "Show"
  • To remove the tweak, change "yes" to "no"

Preserve 2-D Dock Look

This command removes the 3-D visual effect of the dock when it is placed on the bottom of the screen:

  • To change the position of the dock, go to >Dock
  • To remove the tweak, change "yes" to "no"

Add a "Recent Files" Stack to the Dock

  • This command creates a recent-files stack on your dock that you can set to display recent applications, documents, servers, volumes, or items.
  • You can add multiple "recent files" stacks by entering the command into the terminal multiple times.
  • To change the type of recent file shown in the stack, right click on the stack icon and select from the list displayed.

  • You can remove the stacks from the dock by simply dragging the stack out of the dock

Alter List View in Stacks to be More LIke Grid View

  • If you find yourself trying to pick between the "list" and "grid" view for stacks, try this command, which alters the "list" view to looks slightly more like the "grid" view.

  • To change the stack view, right click on the stack icon and select an option under "view content as"
  • To remove the tweak, change "YES" to "NO"

Turn on Stacks Highlights

  • This is another handy command for stacks, which will highlight the item in your stack that your mouse is currently hovering over:

  • To remove the tweak, change "yes" to "no"

Disable Dashboard

  • If you find that you don't use the Dashboard, or it is slowing down your computer, use this command to disable it:

  • You will find that nothing happens when you press the Dashboard icon on the keyboard
  • To remove the tweak, change "yes" to "no"

Drag Widgets to the Desktop

  • This command allows you to use your Dashboard widgets in developer mode, which allows you to drag your widgets to the desktop.

  • After entering the command and restarting the dock, drag a widget to the desktop by clicking and holding on a widget while closing the Dashboard. You’ll notice the widget will continue to be draggable even after the Dashboard closes, allowing you to place it anywhere on the desktop.
  • To put the widget back in the Dashboard, perform the reverse action by clicking and holding the widget while opening the Dashboard.
  • Note: If you are using OS X 10.7 Lion, for this command to work, go to >System Preferences>Mission Control and uncheck the box that says “Show Dashboard as a space”
  • Note: This tweak is not perfect. The widget will always stay hovering above all open windows.
  • To remove the tweak, change “yes” to “no”

X-ray Folders in Quick Look

  • This cool tweak allows you to see thumbnail previews of the contents within a folder when you Quick Look a folder.
  • To use Quick Look, single-click on a folder in the Finder to highlight it, then press the spacebar.
  • Note: This tweak does not work in OS X 10.7 Lion or later

  • To remove the tweak, change "1" to "0"

Add a Message to the Login Window

  • This command can be useful for adding a friendly message to people logging into your Mac, or it can be used for identifying a lost computer.
  • Input your message into the quotes in the command below (currently says: Hi, I am a Mac)
  • After entering the command, you will need to enter your password to execute the command
  • Note: This is a “sudo” command, which if typed incorrectly could potentially harm your computer. Make sure you copy the command correctly.
  • Note: The command does not allow the use of “!” in the message, as it will return an error.

  • To remove the tweak, enter the following command:

Change the Loading Bar in Safari to a Pie Chart

  • Instead of having the address bar in Safari show the loading progress of a web page, this command will use a pie chart instead.

  • To remove the tweak, change "1" to "0"
  • Note: This command does not work in OS X 10.7 Lion or later

Enable the Path View in Finder

  • This handy command for the Finder will allow you to see the path of a file or folder at the top of Finder window.

  • To remove the tweak, change "YES" to "NO"


Add Spaces Between Icons in the Dock

  1. If you have a lot of applications in your Dock, this command will create a blank icon that you can use as a spacer between icons.
  2. To move the spacer, just drag it along the Dock to its desire location.

  • To remove the spacer, simply drag it out of the Dock

Make the Terminal Talk

  • This isn't really a tweak, but if you're feeling a little lonely, this command will let you talk with a new friend!
  • Replace "string" with a phrase for your Mac to say

Tips

  • Important: Although there is a very small chance that you could harm your computer by using any of the following commands, it is always extremely important to backup your computer in case any unwanted changes are made to your computer. Proceed at your own risk! You are responsible for anything that happens to your Mac!
  • Don’t worry though, if the tweak doesn’t work, it shouldn’t cause any harm to your computer. The Terminal will most likely respond with something like “command not found”, or “file not found,” or it may just simply not return anything.
  • Because Apple does make many changes in the code of different operating system versions, some tweaks and customizations may not work, depending on what version of OS X you are using.
  • Note: “sudo” commands, which require you to enter your password to execute the command, are the only commands to be extremely cautious about, since those commands can alter code that’s part of the core operating systems, thereby harming your computer.

Glossary

  • Dashboard: An application included with the Mac that allows the user to organize and use a collection of widgets that can be downloaded from the internet
  • Dock: The bar located at the edge of the screen for quick access to opening applications
  • Finder: The application used on the Mac for navigating user folders, files, documents, pictures, etc.
  • Stacks: An item on the Dock that allows quick access to applications, documents, etc.
  • Terminal: A command line application included with the Mac to interface with the UNIX base which provides the core for the Mac operating system.

Links to Additional Resources

If you wish to tweak your Mac even more, here are a few links with even more tips or Terminal commands to customize your Mac:

Things You'll Need

  • Mac running OS X 10.5 (Leopard) or later

Related Articles

  • Open a Terminal Window in Mac