Tools
- See also: iHook
- Backup / Rsync like
PATH
- Setting $PATH
- path_helper
- Runtime Configuration Guidelines: User Session Environment Variables
~/.MacOSX/environment.plist
- Unix shell initialization
- Mac Commandline Tools
- Manpages
- File permissions, acls, extended attributes, etc.
- chmod
- See section on
ACL MANIPULATION OPTIONS
- See section on
- chflags
- e.g. See the
uchg
(akaimmutable
) flag
- e.g. See the
- On symlinks
- chmod
- caffeinate
- chflags
- distutil
- dns-sd
- Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD)
- dscl
- dscacheutil
- GetFileInfo
- hdiutil
- launchctl
- ls
- Flag
-@
when combined with-l
causes extended attributes to also be listed.
- Flag
- networksetup
- nslookup
- mdfind : mdutil | mdls
- periodic
- plist(5)
- PlistBuddy
- pmset
- Manipulate power management settings.
- Wikipedia
- sandbox-exec
- scutil
- sysctl
- system_profiler
- systemsetup
- xattr
- File permissions, acls, extended attributes, etc.
Snippets
system_profiler
Ref: system_profiler
# What machine do I have? system_profiler SPHardwareDataType SPSoftwareDataType ## Hardware: ## ## Hardware Overview: ## ## Model Name: MacBook Pro ## Model Identifier: MacBookPro10,1 ## Processor Name: Intel Core i7 ## Processor Speed: 2.3 GHz ## Number of Processors: 1 ## Total Number of Cores: 4 ## L2 Cache (per Core): 256 KB ## L3 Cache: 6 MB ## Memory: 16 GB ## Boot ROM Version: MBP101.00EE.B02 ## SMC Version (system): 2.3f36 ## Serial Number (system): XXXXXXXXXXXX ## Hardware UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ## ## Software: ## ## System Software Overview: ## ## System Version: OS X 10.8.5 (12F45) ## Kernel Version: Darwin 12.5.0 ## Boot Volume: cheshire-hd ## Boot Mode: Normal ## Computer Name: cheshire ## User Name: Chirayu Krishnappa (chirayu) ## Secure Virtual Memory: Enabled ## Time since boot: 8 days 18:22 # Show network adapters and overall config system_profiler SPNetworkDataType # What data types are available? system_profiler -listDataTypes # XML output system_profiler -xml SPHardwareDataType SPSoftwareDataType
pmset
pmset -g ac ## Wattage = 85W ## SourceID = 0x0001 ## Current = 4250mA ## Voltage = 20000mW ## AdapterID = 0x0aa1 ## Family Code = 0x0085 ## Serial Number = 0xdeadbeef pmset -g custom # show power settings pmset -g cap # show capabilities pmset -g sched # show schedules
scutil
# What are the current effective / dynamic proxy settings? scutil --proxy # What are the current DNS settings? # The results are detailed. scutil --dns ## usage: scutil ## interactive access to the dynamic store. ## ## or: scutil --prefs [preference-file] ## interactive access to the [raw] stored preferences. ## ## or: scutil [-W] -r nodename ## or: scutil [-W] -r address ## or: scutil [-W] -r local-address remote-address ## check reachability of node, address, or address pair (-W to "watch"). ## ## or: scutil -w dynamic-store-key [ -t timeout ] ## -w wait for presense of dynamic store key ## -t time to wait for key ## ## or: scutil --get pref ## or: scutil --set pref [newval] ## pref display (or set) the specified preference. Valid preferences ## include: ## ComputerName, LocalHostName, HostName ## newval New preference value to be set. If not specified, ## the new value will be read from standard input. ## ## or: scutil --dns ## show DNS configuration. ## ## or: scutil --proxy ## show "proxy" configuration. scutil # > help ## Available commands: ## ## help : list available commands ## f.read file : process commands from file ## quit : quit ## ## d.init : initialize (empty) dictionary ## d.show : show dictionary contents ## d.add key [*#?] val [v2 ...] : add information to dictionary ## (*=array, #=number, ?=boolean) ## d.remove key : remove key from dictionary ## ## list [pattern] : list keys in data store ## add key ["temporary"] : add key in data store w/current dict ## get key : get dict from data store w/key ## set key : set key in data store w/current dict ## show key ["pattern"] : show values in data store w/key ## remove key : remove key from data store ## notify key : notify key in data store ## ## n.list ["pattern"] : list notification keys ## n.add key ["pattern"] : add notification key ## n.remove key ["pattern"] : remove notification key ## n.changes : list changed keys ## n.watch : watch for changes ## n.cancel : cancel notification requests
networksetup
networksetup -listallnetworkservices # Help # ## networksetup -listnetworkserviceorder ## networksetup -listallnetworkservices ## networksetup -listallhardwareports ## networksetup -detectnewhardware ## networksetup -getmacaddress <hardwareport or device name> ## networksetup -getcomputername ## networksetup -setcomputername <name> ## networksetup -getinfo <networkservice> ## networksetup -setmanual <networkservice> <ip> <subnet> <router> ## networksetup -setdhcp <networkservice> [clientid] ## networksetup -setbootp <networkservice> ## networksetup -setmanualwithdhcprouter <networkservice> <ip> ## networksetup -setv4off <networkservice> ## networksetup -setv6off <networkservice> ## networksetup -setv6automatic <networkservice> ## networksetup -setv6manual <networkservice> <networkservice> <address> <prefixlength> <router> ## networksetup -getdnsservers <networkservice> ## networksetup -setdnsservers <networkservice> <dns1> [dns2] [...] ## networksetup -getsearchdomains <networkservice> ## networksetup -setsearchdomains <networkservice> <domain1> [domain2] [...] ## networksetup -create6to4service <newnetworkservicename> ## networksetup -set6to4automatic <networkservice> ## networksetup -set6to4manual <networkservice> <relayaddress> ## networksetup -getftpproxy <networkservice> ## networksetup -setftpproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setftpproxystate <networkservice> <on off> ## networksetup -getwebproxy <networkservice> ## networksetup -setwebproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setwebproxystate <networkservice> <on off> ## networksetup -getsecurewebproxy <networkservice> ## networksetup -setsecurewebproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setsecurewebproxystate <networkservice> <on off> ## networksetup -getstreamingproxy <networkservice> ## networksetup -setstreamingproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setstreamingproxystate <networkservice> <on off> ## networksetup -getgopherproxy <networkservice> ## networksetup -setgopherproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setgopherproxystate <networkservice> <on off> ## networksetup -getsocksfirewallproxy <networkservice> ## networksetup -setsocksfirewallproxy <networkservice> <domain> <port number> <authenticated> <username> <password> ## networksetup -setsocksfirewallproxystate <networkservice> <on off> ## networksetup -getproxybypassdomains <networkservice> ## networksetup -setproxybypassdomains <networkservice> <domain1> [domain2] [...] ## networksetup -getproxyautodiscovery <networkservice> ## networksetup -setproxyautodiscovery <networkservice> <on off> ## networksetup -getpassiveftp <networkservice> ## networksetup -setpassiveftp <networkservice> <on off> ## networksetup -getairportnetwork <device name> ## networksetup -setairportnetwork <device name> <network> [password] ## networksetup -getairportpower <device name> ## networksetup -setairportpower <device name> <on off> ## networksetup -listpreferredwirelessnetworks <device name> ## networksetup -addpreferredwirelessnetworkatindex <device name> <network> <index> <security type> [password] ## networksetup -removepreferredwirelessnetwork <device name> <network> ## networksetup -removeallpreferredwirelessnetworks <device name> ## networksetup -getnetworkserviceenabled <networkservice> ## networksetup -setnetworkserviceenabled <networkservice> <on off> ## networksetup -createnetworkservice <newnetworkservicename> <hardwareport> ## networksetup -renamenetworkservice <networkservice> <newnetworkservicename> ## networksetup -duplicatenetworkservice <networkservice> <newnetworkservicename> ## networksetup -removenetworkservice <networkservice> ## networksetup -ordernetworkservices <service1> <service2> <service3> <...> ## networksetup -getMTU <hardwareport or device name> ## networksetup -setMTU <hardwareport or device name> <value> ## networksetup -listvalidMTUrange <hardwareport or device name> ## networksetup -getmedia <hardwareport or device name> ## networksetup -setmedia <hardwareport or device name> <subtype> [option1] [option2] [...] ## networksetup -listvalidmedia <hardwareport or device name> ## networksetup -createVLAN <VLAN name> <parent device name> <tag> ## networksetup -deleteVLAN <VLAN name> <parent device name> <tag> ## networksetup -listVLANs ## networksetup -listdevicesthatsupportVLAN ## networksetup -isBondSupported <hardwareport> ## networksetup -createBond <bondname> <hardwareport1> <hardwareport2> <...> ## networksetup -deleteBond <bonddevicename> ## networksetup -addDeviceToBond <hardwareport> <bonddevicename> ## networksetup -removeDeviceFromBond <hardwareport> <bonddevicename> ## networksetup -listBonds ## networksetup -showBondStatus <bonddevicename> ## networksetup -listpppoeservices ## networksetup -showpppoestatus <service name ie., MyPPPoEService> ## networksetup -createpppoeservice <device name ie., en0> <service name> <account name> <password> [pppoe service name] ## networksetup -deletepppoeservice <service name> ## networksetup -setpppoeaccountname <service name> <account name> ## networksetup -setpppoepassword <service name> <password> ## networksetup -connectpppoeservice <service name> ## networksetup -disconnectpppoeservice <service name> ## networksetup -getcurrentlocation ## networksetup -listlocations ## networksetup -createlocation <location name> [populate] ## networksetup -deletelocation <location name> ## networksetup -switchtolocation <location name> ## networksetup -listalluserprofiles ## networksetup -listloginprofiles <service name> ## networksetup -enablesystemprofile <service name> <on off> ## networksetup -enableloginprofile <service name> <profile name> <on off> ## networksetup -enableuserprofile <profile name> <on off> ## networksetup -import8021xProfiles <service name> <file path> ## networksetup -export8021xProfiles <service name> <file path> <yes no> ## networksetup -export8021xUserProfiles <file path> <yes no> ## networksetup -export8021xLoginProfiles <service name> <file path> <yes no> ## networksetup -export8021xSystemProfile <service name> <file path> <yes no> ## networksetup -settlsidentityonsystemprofile <service name> <file path> <passphrase> ## >networksetup -settlsidentityonuserprofile <profile name> <file path> <passphrase>networksetup -deletesystemprofile <service name> ## networksetup -deleteloginprofile <service name> <profile name> ## networksetup -deleteuserprofile <profile name> ## networksetup -resetBMCToDefaults ## networksetup -showBMCSettings ## networksetup -setupBMC <lan port> < static dhcp> <ip address> <subnet mask> <router address> <admin name> <password> ## networksetup -version ## networksetup -help ## networksetup -printcommands ## ** Error: The amount of parameters was not correct.