What I love about OSX is its UNIX(-like) foundation. There are the default UNIX command line tools but also lots of OSX specific commands. This is a compilation of some of these commands you might not know. Feel free to comment.
This is a mere list of commands with a short description and one or two examples. To find out more of course use man command
.
Commands may destroy all your data or cause a nuclear meltdown — use only if you know what you are doing.
Configuration and networking
systemsetup
- Manage a variety of configuration stuff.
systemsetup -getcomputername # display computer name
softwareupdate
- Execute Apple Software update from the commandline
sudo softwareupdate -i -a # install all available updates
networksetup
- Manage the network configuration
sudo networksetup -switchtolocation home # switch network locations
dscl
- Directory service management, for example users, groups etc. – complex stuff, mostly for use on OSX server
dscacheutil
- Manage DNS cache
system_profiler
- View system information (Like SystemProfiler.app in Utilities)
Files
chflags
- Change file flags, like “hidden”, “archived”..
/Developer/Tools/GetFileInfo
- View extended file attributes, like icon, creator and so on. To write these attributes use SetFileInfo
Disks and images
diskutil
- Manage local disks
sudo diskutil repairPermissions / # repair permissions
hdiutil
- Manage disk images
hdiutil create -srcfolder path any.dmg # create dmg-image from folder
newfs_hfs
- Format a disk
drutil
- Interact with CD/DVD drives
drutil status # show detailed information about drives and media
Misc
open
- Open a file with a given application.
open . # opens a new finder window with the current commandline path
pbcopy/pbpaste
- Access OSX clipboard
mdutil
- Manage Spotlight
screencapture
- Take a screenshot
osascript
- Run Applescript from the shell
sudo osascript -e "set Volume 0" # set system volume to zero
qlmanage
- Manage QuickLook
periodic
- Run periodic system jobs
Ressources
More in-depth information can be found here:
some good tips here… haven’t seen the quick look one before. cheers!