Wednesday, December 28, 2016

Mac OS X: open apps from the shell

A few example aliases I use for opening URLs in web browsers and previewing images in Preview.app.

alias chrome="open -a google\ chrome"
alias firefox="open -a firefox"
alias safari="open -a safari"
alias preview="open -a preview"

Tuesday, December 27, 2016

Mac OS X: Enable and disable wifi from the shell

Enable and disable wifi from the shell in Max OS X.

networksetup -setairportpower en0 on
networksetup -setairportpower en0 off

Consider wrapping that in an alias in your .bash_profile or .profile.

alias wifion="networksetup -setairportpower en0 on"
alias wifioff="networksetup -setairportpower en0 off"