Useful terminal commands for Mac OS X

RHochstenbach

Administrator
Here's a list of useful commands for Mac OS X. These have been tested on 10.5, but should also work with 10.4. I'll keep this list updated.

The terminal is located in Applications > Utilities > Terminal. You can drag this icon to the Dock to be able to launch it faster.

Disable Disk Image Verification
By default when you open a Disk Image (.dmg), it will first verify the contents of the image. This can be disabled with this command:

Code:
defaults write com.apple.frameworks.diskimages skip-verify true

You can restore this setting with this command:

Code:
defaults write com.apple.frameworks.diskimages skip-verify false

Use your screensaver as wallpaper
You can use your current screensaver as a wallpaper for your desktop. You can do this with the following command:
Code:
cd /System/Library/Frameworks/ScreenSaver.framework/Resources/
cd ScreenSaverEngine.app/Contents/MacOS/
./ScreenSaverEngine -background &

The terminal should reply with a PID number. Note this number. You need it to restore your desktop.

You can restore it with this:
Code:
kill PID XX
XX stands for the PID number.

The desktop is also restored after logging off and then back on.

Moving the Dock to the Left or Right
You can move your Dock to the Left or Right by using a single command.

Left:
Code:
defaults write com.apple.dock pinning -string start
killall Dock
Right:
Code:
defaults write com.apple.dock pinning -string end
killall Dock
Restore:
Code:
defaults write com.apple.dock pinning -string ""
killall Dock

Eject a disc
Sometimes there's a possibiity that yu can't eject a disc with the Eject-button. You can force it with this command:
Code:
disktool -e disk#

Make the icons of hidden applications in the Dock transparent
You can make the icons in the Dock of hidden applicaitons transparent with this command:
Code:
defaults write com.apple.Dock showhidden -bool YES
Reverse it with this:
Code:
defaults write com.apple.Dock showhidden -bool NO

Put widgets on the Desktop
By default, the Widgets are only visible when you open the Dashboard. But with a minor modification you can drag them to your Desktop.

Use this command:
Code:
defaults write com.apple.dashboard devmode YES
Now restart your Dock;
Code:
killall Dock
Now you can drag Widgets to your Desktop. To restore it, use this command:
Code:
defaults write com.apple.dashboard devmode NO
Then restart our Dock again.

Show hidden files in the Finder
To show hidden files in the Finder, use this command:
Code:
defaults write com.apple.finder AppleShowAllFiles TRUE
To restore it:
Code:
defaults write com.apple.finder AppleShowAllFiles FALSE
 
Back
Top