by Morgan Aldridge email@example.com
A small collection of command line tools that I've developed for Mac OS X over the years, à la NextStep/Mac OS X's
pbpaste, etc. These are mostly
bash scripts as an exercise in honing my bash-fu, but a number of Perl & Ruby scripts have been submitted by others.
clipcat prints and concatenates Mac OS Text Clippings. Submitted by David Kendal https://gist.github.com/705623.
dict performs a look-up in Mac OS X's included dictionary. Note: unlike the other scripts provided, this one requires that you have MacRuby installed http://macruby.org/. Submitted by David Kendal.
eject ejects a volume or network volume and all other volumes on the same local device. A shorter, simpler, smarter wrapper of
diskutil's various eject/unmount options and allows specifying either a full path in /Volumes or just the volume name.
ql opens files with Mac OS X's Quick Look feature.
swuser switches users using Mac OS X's Fast User Switching feature. You can either switch out to the login window or to another user. Note: unfortunately, this is not currently compatible with
trash allows trashing of files instead of tempting fate with
rm. Correctly handles trashing files on other volumes, uses the same filename renaming scheme as Finder for duplicate file names, can list trash contents w/disk usage summary, and empty trash (including securely) w/confirmation. Does not require Finder to be running.
with sets the application with which specified documents will be opened. It can even change and open in one fell swoop. Submitted by David Kendal.
- Download and extract the tools.
sudo rake install. (If you have write permission on
/usr/local/bin, you don't need to
Looking for other Mac OS X-specific command line tools to complement these? Check out the following:
launchby Nicholas Riley
trashby Ali Rantakari
contactsby Shane Celis
dockutilby Kyle Crawford
dutiby Andrew Mortensen
get-locationby David Lindes
ilocby Nate Weaver
imsgby Christian Sampaio
ithiefby Israel Chauca Fuentes
- osxiconutils (
seticon) & osxutils (
wsupdate) by Sveinbjorn Thordarson
pngpasteby Jerry Chen
remby Kevin Y. Kim
serviceby David Kendal
tagby James Berry
trashby Dave Dribin
trashby Sindre Sorhus
webkit2pngby Paul Hammond
Special thanks to: David Kendal for all his submissions and collaboration; Matt Brictson for his initial relative path bug fix in
trash; huyz for the improved determination of Finder's PID to prevent possible false-positives in