John Siu Blog

Tech - Business Tool, Personal Toys

Mac OS Commands

☰ Table of Content

Some Mac OS commands.

Play audio file

1
afplay <file>

Plist content

1
plutil -p <file>

Launch Control

1
2
3
launchctl list # List services
launchctl load <plist file> # Start service
launchctl unload <plist file> # Stop service

System Service Location

  • /Library/LaunchDaemons/
  • /System/Library/LaunchDaemons/

Change Hostname

1
sudo scutil --set HostName <hostname>

Mouse Speed

  • Get Current
1
defaults read -g com.apple.mouse.scaling
  • Set New value
1
defaults write -g com.apple.mouse.scaling your_mouse_speed

May need reboot.

dns-sd(mdns)

Get address of hostname

1
dns-sd -G v4v6 <hostname>

Kernel Extension

  • List all kernel extension
1
kextstat
  • List all non-Apple extension
1
kextstat | grep -v com.apple

Safe Mode

Hold down Shift during boot.

Using command line:

1
2
sudo nvram boot-args="-x"
sudo nvram boot-args="-x -v"

Change back to normal:

1
sudo nvram boot-args=""

Toggle Hidden File in Finder

  • Command+Shift+.

Network Setup Command

Help

1
networksetup

List all network service

1
networksetup -listallnetworkservices

Turn network service on/off

1
2
3
networksetup -setnetworkserviceenabled <networkservice> <on off>
networksetup -setnetworkserviceenabled Ethernet off
networksetup -setnetworkserviceenabled Ethernet on

John Siu

Update: 2020-07-21
comments powered by Disqus