├── setup.py ├── install ├── README.md ├── edify └── com.github.edify.plist /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | '''setup for edify''' 4 | 5 | from distutils.core import setup 6 | import setuptools 7 | 8 | setup(name='edify', 9 | version='0.1.0', 10 | description='This script displays information on commonly run commands.', 11 | author='Joseph Chilcote', 12 | author_email='chilcote@gmail.com', 13 | url='https://www.github.com/chilcote/edify/', 14 | license='Apache 2.0', 15 | packages=['edify'], 16 | ) -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # Copyright 2014 Joseph Chilcote 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | # use this file except in compliance with the License. You may obtain a copy 8 | # of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | ############################################################################## 18 | 19 | if [ ! -d /usr/local/share/edify ]; then 20 | /bin/mkdir -p /usr/local/share/edify 21 | fi 22 | /usr/bin/install -m 755 -g admin -o root ./edify /usr/local/bin/ 23 | /usr/bin/install -m 755 -g wheel -o root ./com.github.edify.plist /usr/local/share/edify/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | edify 2 | ===== 3 | 4 | This script stores and displays custom cli arguments with respective short descriptions, useful for OS X sysadmins. 5 | 6 | For a long time, whenever I've come across an interesting command or a specific argument to which I would routinely return, I'd open up [nvAlt](http://brettterpstra.com/projects/nvalt/) and store the command there, along with a short description to remind my failing brain later what it was that I found so very interesting in the first place. 7 | 8 | However, this started to prove inefficient. I'd be in Terminal, and would need to switch over to nvAlt, search for the command, read through my sloppy notes, find the specific invocation, attempt to copy it to the clipboard, switch back to Terminal, paste, and then get annoyed that the trailing return was also added to the clipboard. 9 | 10 | Inspired by apps such as [Dash](http://kapeli.com/dash) and a [twittering](https://twitter.com/zoocoup/status/547061584728981505) by Jason Broccardo, I thought it might be nice to make something that would allow me to organize and search my commands, and which could be shared and/or appended by anyone. 11 | 12 | Requirements 13 | ------------ 14 | 15 | + python 2.7.x 16 | + I've only tested on 10.10.x. 17 | 18 | Usage 19 | ----- 20 | 21 | usage: edify [-h] [-a] [-l] [-g GREP] 22 | 23 | optional arguments: 24 | -h, --help show this help message and exit 25 | -a, --add Add entry to local plist 26 | -l, --list List all entries 27 | -g GREP, --grep GREP Search entries for string 28 | 29 | Installation 30 | ------------ 31 | 32 | Clone the repo and run the install script. The edify script is installed into `/usr/local/bin/` while the plist is installed into `/usr/local/share/edify/`, creating the enclosing directory if needed. 33 | 34 | git clone https://github.com/chilcote/edify.git && cd edify 35 | sudo ./install 36 | 37 | Listing and Searching items 38 | --------------------------- 39 | 40 | Generate a list of all commands in both the cached and local plists with the `-l` or `--list` argument: 41 | 42 | edify -l 43 | 44 | Search for a case-insensitive string by invoking the `-g` or `--grep` argument: 45 | 46 | edify -g 'foo' 47 | 48 | 49 | Adding commands locally 50 | ----------------------- 51 | 52 | To add commands that you want to keep local, either because it contains site-specific information, or because you're a crumudgeon, you can do so with the `-a` or `--add` argument. The information will be stored at `~/Library/Application Support/edify/com.github.edify.plist`. 53 | 54 | edify -a 55 | 56 | You will be prompted for two items: The command syntax and a short description. 57 | 58 | Enter the command: 59 | Enter description: 60 | 61 | Enter the appropriate information and it will be added to your local plist. 62 | 63 | 64 | Contributing 65 | ------------ 66 | 67 | To contribute to the master plist, change directory to your fork, create a branch, and use the hidden `-e` or `--edit` argument: 68 | 69 | ./edify -e 70 | 71 | You will be prompted for two items: The command syntax and a short description. 72 | 73 | Enter the command: 74 | Enter description: 75 | 76 | Enter the appropriate information and it will be added to the master plist. Pull requests are welcome. 77 | 78 | 79 | License 80 | ------- 81 | 82 | Copyright 2014 Joseph Chilcote 83 | 84 | Licensed under the Apache License, Version 2.0 (the "License"); 85 | you may not use this file except in compliance with the License. 86 | You may obtain a copy of the License at 87 | 88 | http://www.apache.org/licenses/LICENSE-2.0 89 | 90 | Unless required by applicable law or agreed to in writing, software 91 | distributed under the License is distributed on an "AS IS" BASIS, 92 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 93 | See the License for the specific language governing permissions and 94 | limitations under the License. 95 | -------------------------------------------------------------------------------- /edify: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | """ 4 | This script displays information on commonly run commands. 5 | 6 | Requirements: 7 | python 2.7.x 8 | """ 9 | ############################################################################## 10 | # Copyright 2014 Joseph Chilcote 11 | # 12 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 13 | # use this file except in compliance with the License. You may obtain a copy 14 | # of the License at 15 | # 16 | # http://www.apache.org/licenses/LICENSE-2.0 17 | # 18 | # Unless required by applicable law or agreed to in writing, software 19 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 20 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 21 | # License for the specific language governing permissions and limitations 22 | # under the License. 23 | ############################################################################## 24 | 25 | 26 | __author__ = "Joseph Chilcote (chilcote@gmail.com)" 27 | __version__ = "0.2.1" 28 | 29 | import argparse 30 | import os 31 | import plistlib 32 | import sys 33 | import textwrap 34 | 35 | try: 36 | input = raw_input 37 | except NameError: 38 | pass 39 | 40 | 41 | def colored(text, color=None): 42 | if not os.getenv("ANSI_COLORS_DISABLED"): 43 | fmt_str = "\033[%dm" 44 | reset = "\033[0m" 45 | colors = { 46 | "red": 31, 47 | "green": 32, 48 | "yellow": 33, 49 | "magenta": 35, 50 | "cyan": 36, 51 | "white": 37, 52 | } 53 | if color is not None: 54 | text = fmt_str % (colors[color]) + text + reset 55 | return text 56 | 57 | 58 | def list_all(d): 59 | li = [] 60 | for k, v in d.items(): 61 | if "sudo" in k: 62 | k = k.replace("sudo ", "") 63 | li.append(k) 64 | for i in sorted(li): 65 | print(colored(i, "cyan")) 66 | 67 | 68 | def add_item(d, plist): 69 | a = d.copy() 70 | command = input("Enter the command: ") 71 | notes = input("Enter description: ") 72 | a[command] = notes 73 | try: 74 | with open(plist, 'wb') as f: 75 | plistlib.dump(a, f) 76 | except UnicodeDecodeError: 77 | print( 78 | colored( 79 | "Encoding error. Check your command for unicode " 80 | + "characters and try again.", 81 | "red", 82 | ) 83 | ) 84 | print(colored("Command: %s" % command, "cyan")) 85 | with open (plist, 'wb') as f: 86 | plistlib.dump(d, f) 87 | sys.exit(1) 88 | print_item(command, notes) 89 | 90 | 91 | def search_items(d, search_term): 92 | for k, v in sorted(d.items()): 93 | # if all(s.lower() in k.lower() for s in search_term) or all(s.lower() in v.lower() for s in search_term): 94 | if all(s.lower() in (k + v).lower() for s in search_term): 95 | print_item(k, v) 96 | 97 | 98 | def print_item(k, v): 99 | li = textwrap.wrap(v, 120) 100 | for i in li: 101 | print(colored("## %s" % i, "yellow")) 102 | print(colored("%s" % k, "cyan")) 103 | 104 | 105 | def main(): 106 | """Main method""" 107 | parser = argparse.ArgumentParser() 108 | parser.add_argument( 109 | "-a", "--add", help="Add entry to local plist", action="store_true" 110 | ) 111 | parser.add_argument("-e", "--edit", help=argparse.SUPPRESS, action="store_true") 112 | parser.add_argument("-l", "--list", help="List all entries", action="store_true") 113 | parser.add_argument("-g", "--grep", nargs='*', help="Search entries for string") 114 | args = parser.parse_args() 115 | 116 | # Instantiate variables 117 | d = {} 118 | main_plist = os.path.join(os.getcwd(), "com.github.edify.plist") 119 | cached_plist = "/usr/local/share/edify/com.github.edify.plist" 120 | local_plist = os.path.expanduser( 121 | "~/Library/Application Support/edify/com.github.edify.plist" 122 | ) 123 | 124 | if args.edit: 125 | if os.path.exists(main_plist): 126 | print(colored("Master Edit Mode", "yellow")) 127 | with open(main_plist, 'rb') as f: 128 | d = plistlib.load(f) 129 | else: 130 | print(colored("Master plist must be in the current directory.", "red")) 131 | sys.exit(1) 132 | add_item(d, main_plist) 133 | sys.exit(0) 134 | 135 | if os.path.exists(cached_plist): 136 | with open(cached_plist, 'rb') as f: 137 | d = plistlib.load(f) 138 | if os.path.exists(local_plist): 139 | with open(local_plist, 'rb') as f: 140 | d.update(plistlib.load(f)) 141 | else: 142 | print(colored("File not found: %s\nPlease reinstall" % cached_plist, "red")) 143 | sys.exit(1) 144 | 145 | if args.list: 146 | list_all(d) 147 | elif args.grep: 148 | search_items(d, args.grep) 149 | elif args.add: 150 | d = {} 151 | if not os.path.exists(os.path.dirname(local_plist)): 152 | os.mkdir(os.path.dirname(local_plist)) 153 | if os.path.exists(local_plist): 154 | with open(local_plist, 'rb') as f: 155 | d = plistlib.load(f) 156 | add_item(d, local_plist) 157 | else: 158 | parser.print_help() 159 | sys.exit(0) 160 | 161 | 162 | if __name__ == "__main__": 163 | main() 164 | -------------------------------------------------------------------------------- /com.github.edify.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | "/Applications/Install OS X El Capitan.app/Contents/Resources/startosinstall --nointeraction --volume /Volumes/Macintosh\ HD --applicationpath "/Applications/Install OS X El Capitan.app" 8 | Non-interactively update OS X to 10.11. 9 | ./kmfddm/tools/api-status-values-get.sh $ID '.StatusItems.device.model.family' | jq . 10 | KFMDDM command for returning device model family. 11 | ./kmfddm/tools/api-status-values-get.sh $ID '.StatusItems.device.model.identifier' | jq . 12 | KMFDDM command for returning status values. 13 | ./kmfddm/tools/api-status-values-get.sh $ID '.StatusItems.device.operating-system.version' | jq . 14 | KMFDDM command for returning operating system version. 15 | ./kmfddm/tools/api-status-values-get.sh $ID '.StatusItems.device.power.battery-health' | jq . 16 | KMFDDM command for returning battery health info. 17 | /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/startosinstall --agreetolicense --rebootdelay 90 --eraseinstall --newvolumename "Macintosh HD" --forcequitapps --user username --passprompt 18 | Run startosinstall interactively to erase and install macOS. 19 | /Library/Application\ Support/JAMF/bin/Management\ Action.app/Contents/MacOS/Management\ Action -message 'foo' -title 'bar' -subtitle 'baz' -sound default -open URL -activate com.apple.Terminal 20 | Jamf app to send notifications to notification center. 21 | /Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help 22 | Jamf Helper options. 23 | /System/Library/CoreServices/Applications/Network\ Utility.app/Contents/Resources/stroke www.google.com 80 80 24 | Similar to nmap, scan a range of ports on a host. 25 | /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend 26 | Lock screen. 27 | /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users foo,bar,baz -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw 'foo' -privs -all -restart -agent 28 | Activate screen sharing and include a VNC password. 29 | /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users foo,bar,baz -privs -all -restart -agent 30 | Turn on screen sharing for admin users. 31 | /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw 'foo' -privs -all -restart -agent 32 | Set the VNC password in screen sharing. 33 | /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off 34 | Turn off Remote Management 35 | /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I 36 | Get information about the airport connection. 37 | /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s 38 | Scan available wireless networks. 39 | /System/Library/PrivateFrameworks/ApplePushService.framework/apsctl status | grep 'com.apple.aps.mdmclient.daemon.push.production' -A23 40 | Return information for your mdmclient since last reboot. 41 | /System/Library/PrivateFrameworks/ApplePushService.framework/apsctl status | grep 'connection environment:' -A21 42 | Return connectivity summaries for MDM environments. 43 | /System/Library/PrivateFrameworks/Seeding.framework/Resources/seedutil enroll CATALOG 44 | Configure a software update appleseed catalog (CustomerSeed, DeveloperSeed, PublicSeed). 45 | /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/Resources/DirectoryTools -repairPermissions username 46 | Repair permissions of a given username. Useful when migrating local accounts. 47 | /opt/cisco/secureclient/bin/acinstallhelper -launchAtLogin -disable 48 | Unload the login item for Secure Client. 49 | /usr/bin/AssetCacheLocatorUtil 50 | Get the caching server being used by this mac. 51 | /usr/bin/csrutil clear 52 | Reset SIP (10.12.2 and above) 53 | /usr/bin/defaults read /Library/Preferences/com.apple.alf globalstate 54 | Get the status of the firewall state (0 = off; 1 = on) 55 | /usr/bin/open "x-apple.systempreferences:com.apple.preferences.softwareupdate?client=bau&installMajorOSBundle=com.apple.InstallAssistant.Seed.macOS1015Seed1" 56 | Grab the Catalina seed installer. 57 | /usr/bin/security authorizationdb read system.login.console 58 | Read authorizationdb values. 59 | /usr/bin/security find-certificate -a -c "MicroMDM Identity (hostname)" -p -Z "/Library/Keychains/System.keychain" | /usr/bin/openssl x509 -noout -enddate| cut -f2 -d= 60 | Get information about MicroMDM Identity Cert (pass the name of the cert). 61 | /usr/bin/security find-generic-password -l "Enterprise Connect" /Users/$loggedinuser/Library/Keychains/login.keychain | awk -F "=" '/acct/ {print $2}' | tr -d "\"" 62 | Get the username from Enterprise Connect keychain entry. 63 | /usr/bin/xcode-select --install 64 | Prompt to install Xcode command line utilities. 65 | /usr/libexec/ApplicationFirewall/socketfilterfw --add /path/to/app 66 | Add application to firewall. 67 | /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate 68 | Show firewall status. 69 | /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off 70 | Disable firewall. 71 | /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on 72 | Enable firewall. 73 | /usr/libexec/java_home 74 | Determine the version of Java being used. 75 | /usr/libexec/repair_packages --list-standard-pkgs 76 | Print the standard packages that repairPermissions will look at. 77 | /usr/local/jamf/bin/jamf help -hidden 78 | Show hidden jamf binary options. 79 | /usr/local/micromdm/build/linux/mdmctl apply blueprints -f new_blueprint.json 80 | MicroMDM: apply new blueprint. 81 | /usr/local/micromdm/build/linux/mdmctl apply profiles -f ./TCC.mobileconfig 82 | MicroMDM: add a profile. 83 | /usr/local/micromdm/build/linux/mdmctl get blueprints -name default_blueprint 84 | MicroMDM: get blueprint by name. 85 | /usr/local/micromdm/build/linux/mdmctl get-profiles 86 | MicroMDM: get list of profiles. 87 | /usr/local/micromdm/build/linux/mdmctl remove devices -serials foo,bar 88 | MicroMDM: remove devices by serial. 89 | /usr/sbin/dseditgroup -o edit -a foo -t user admin 90 | Add a user to admin group. 91 | /usr/sbin/dseditgroup -o edit -a foo -t user com.apple.access_ssh 92 | Add a user to the ssh access group. 93 | /usr/sbin/ipconfig getsummary en0 en1 | awk -F ' SSID : ' '/ SSID : / {print $2}' |grep -i <SSID> 94 | Command to confirm the current SSID in use. 95 | /usr/sbin/scutil -w State:/Network/Global/DNS -t 180 96 | A way to wait for network to be active before proceeding in a script. 97 | Enable root from RecoveryOS (Apple Silicon) 98 | dscl -f /Volumes/Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root 99 | Enable root from RecoveryOS (Intel) 100 | dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root 101 | Profiles -Lo stdout-xml 102 | Print the contents/settings of a config profile 103 | Query local cache of DDM Software Updates declarations. 104 | sudo plutil -p db/softwareupdate/SoftwareUpdateDDMStatePersistence.plist 105 | Return logs for AirDrop activity. 106 | log show --predicate 'subsystem == "com.apple.sharing" and category == "AirDropNW" and eventMessage contains[c] "Conversion"' 107 | ac -p | sort -nrk 2 | awk 'NR == 2 { print $1; exit }' 108 | Returns the username of the user with longest time logged in. 109 | app-sso platform -s 110 | Return details about PlatformSSO settings. 111 | arch -x86_64 /bin/test 0 112 | Will return 0 if A) is an Intel Mac; B) Has Rosetta installed/available. 113 | arp -ad 114 | Clears the arp cache. 115 | asr restore --source foo --target bar --erase --verbose --noprompt --noverify --buffers 1 --buffersize 32m --puppetstrings 116 | Full arguments for asr restores. 117 | atsutil databases -remove 118 | Removes all user-based and system font caches. 119 | atsutil databases -removeUser ; sudo atsutil databases -remove ; atsutil server -shutdown 120 | Clear font caches. 121 | atsutil server -ping 122 | Starts the Apple Type Services service. 123 | atsutil server -shutdown 124 | Stops the Apple Type Services service. 125 | auth sufficient pam_tid.so 126 | Add to /etc/pam.d/sudo to allow Touch ID 127 | autopkg repo-list |awk -F'(' '{print $2}' |tr -d \) 128 | List current autopkg repos. 129 | bash <(curl -sL http://url/script) 130 | Run bash command over http in Recovery Mode. (Don't do this). 131 | bless --folder /System/Library/CoreServices/ --setBoot 132 | Bless a system folder (helpful for encrypting APFS boot volumes in Fusion) 133 | bless --netboot --server bsdp://IP.Address 134 | Bless a netboot server. 135 | caffeinate -s command -with arguments 136 | Allow a command to run for a prolonged period without sleep. 137 | caffeinate -u -t 3600 138 | Prevent Mac from falling asleep for an hour. 139 | cat /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound 140 | Inspect the MDM cloud configuration file (aka dep profile). 141 | chef-shell -z -c /etc/chef/client.rb 142 | Run chef in interactive mode including all resources. 143 | chsh -s /bin/zsh 144 | Change default shell to zsh. 145 | cmdr.py ScheduleOSUpdate InstallASAP --version 12.5.1 |base64 |pbcopy 146 | Example MicroMDM cmdr to create command for pushing a softwareupdate via MDM. 147 | cmdr.py Settings --allowbst |base64 |pbcopy 148 | Use MicroMDM cmdr tool to create command to tell client to allow bootstraptoken to be escrowed. 149 | codesign --display /Applications/Foo.app 150 | Display the exectuable of an app. 151 | codesign -dr - /Applications/Foo.app 152 | Return the anchor cert for an app (useful for TCC/PPPC) 153 | codesign -dv --verbose=4 /Applications/Foo.app 154 | Check code signing for an app. 155 | codesign -dvvv /Applications/Foo.app 156 | Verify signing of an application. 157 | command > /dev/null 2>&1 158 | Bash redirect stdin and stderror to /dev/null. 159 | cp foo{,-bar} 160 | Use brackets to copy a file, renaming in place. 161 | cp foo{-bar,-baz} 162 | Use brackets to copy a file, making several backups, renaming in place. 163 | createhomedir -c 164 | Initiate home directories for local accounts. 165 | curl -s https://mesu.apple.com/assets/macos/com_apple_macOSIPSW/com_apple_macOSIPSW.xml | grep "\.ipsw" | tr -d '\t' | uniq | xmllint --xpath '/string/text()' - 166 | Grab the URL of the current macOS IPSW 167 | curl ipecho.net/plain 168 | Returns your external facing IP address. Ref: http://krypted.com/mac-security/grab-your-wan-ip-in-scripts/ 169 | date "+%Y%m%d" 170 | Generate a numeric date for use in a script. 171 | dd if=/dev/random bs=16 count=1 2>/dev/null | base64 | sed 's/=//g' 172 | Generate 128bit password. 173 | defaults delete -g EnablePasteboardPrivacyDeveloperPreview 174 | Remove global defaults for testing Pasteboard privacy changes. 175 | defaults delete /Library/Preferences/com.apple.SoftwareUpdate SUDisableEVCheck 176 | Disable the SUDisableEVCheck setting for softwareupdate. 177 | defaults delete /Library/Preferences/com.apple.seeding 178 | Remove the seeding pref for appleseed. 179 | defaults read /Applications/Foo.app/Contents.Info CFBundleShortVersionString 180 | Get the version no. of an app. 181 | defaults read com.apple.preferences.softwareupdate ProductKeysLastSeenByUser 182 | Return the most recent known product key from softwareupdate scans (useful for getting the beta key since they do not bump the version). 183 | defaults write -g EnablePasteboardPrivacyDeveloperPreview -bool yes 184 | Enable global defaults for testing Pasteboard privacy changes. 185 | defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://server.domain.com 186 | Change the SUS server, i.e. for use with Reposado. 187 | defaults write com.apple.Enterprise-Connect debugMode -bool true 188 | Enable debug mode for Enterprise Connect. 189 | defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true 190 | Enable airdrop. 191 | defaults write com.apple.ScreenSharing DoNotSendSystemKeys -bool YES 192 | Disable cmd-tab inside a Screen Sharing session. 193 | defaults write com.apple.TextEdit RichText -int 0 194 | Set TextEdit to use plain text by default. 195 | defaults write com.apple.desktopservices DSDontWriteNetworkStores true 196 | Keep from writing .DS_Store files to file servers. 197 | defaults write com.apple.finder QLEnableTextSelection -bool TRUE ; killall Finder 198 | Enable text selection in QuickLook. 199 | defaults write com.microsoft.autoupdate2 ExtendedLogging -bool TRUE 200 | Enable extended logging for Microsoft Autoupdate (MAU) tool. 201 | defaults write com.microsoft.autoupdate2 ExtendedLogging -bool true 202 | Turn on debug logging for Microsoft AutoUpdate (logs to /Library/Logs/Microsoft/autoupdate.log) 203 | df -h | awk '/disk1/ {print $1,$2,$3}' 204 | Print the device, available space, and used space for disk1. 205 | diff -y 206 | Display diff in split screen. 207 | dig +short myip.opendns.com @resolver1.opendns.com 208 | Return your external facing IP address. 209 | dig -t srv _ldap._tcp.DOMAIN | /usr/bin/awk '/^_ldap/{print $NF}' 210 | Return LDAP server information about DOMAIN. 211 | discoveryutil mdnsflushcache 212 | Reset the DNS cache (10.10) (Multicast). 213 | discoveryutil udnsflushcache 214 | Reset the DNS cache (10.10) (Unicast). 215 | diskutil info `bless --getBoot` |sed '/^ *Volume Name: */!d;s###' 216 | Return the current boot drive. 217 | diskutil mount disk0s3 > /dev/null 2>&1 ; defaults read /Volumes/Recovery\ HD/com.apple.recovery.boot/SystemVersion.plist ProductVersion ; diskutil unmount disk0s3 > /dev/null 2>&1 218 | Check the OS version of the current recovery partition. 219 | dns-sd -B _net-assistant._udp . >> /tmp/ARDhosts; cat /tmp/ARDhosts | awk -F"._udp." '{print $2}' | sort | uniq 220 | Discover Macs on the network; run for 30 seconds and cancel to print results. 221 | dscacheutil -q host -a name foo |awk -F': ' '/ip_address/ {print $2}' 222 | Get IP of a host. 223 | dscacheutil -q user -a name foo 224 | Get lookup info on user 'foo'. 225 | dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root 226 | Enable root account in Recovery 227 | dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }' 228 | List all user accounts with UID greater than 500. 229 | dscl . passwd /Users/foo "" 230 | Set a blank password for user foo. 231 | dscl localhost read /Search/Users/$USER msDSUserPasswordExpiryTimeComputed 232 | Return the expiration date of an Active Directory user. 233 | dsconfigad -force -remove -u foo -p bar 234 | Unbind from AD. 235 | dsconfigad -show | awk '/Active Directory Domain/{print $NF}' 236 | Return the AD domain. 237 | dseditgroup -o create -q com.apple.access_ssh 238 | Create an SSH access group. 239 | dseditgroup -o delete -t group com.apple.access_ssh 240 | Delete an existing SSH access group. 241 | dseditgroup -o edit -a "DOMAIN\Domain Admins" -t group com.apple.access_ssh 242 | Add a group to the SSH access group. 243 | dsmemberutil checkmembership -U username -G admin 244 | Check if user 'username' is an admin account. 245 | du -ch -d 1 /foo 246 | Print filesystem usage in human readable format, with a depth of one directory. 247 | echo "$password" | "$startos" --agreetolicense --rebootdelay 90 --eraseinstall --newvolumename "Macintosh HD" --forcequitapps --user "$currentuser" --stdinpass 248 | Automate startosinstall by passing the password as stdin. 249 | echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | sudo scutil 250 | Renew DHCP lease in a script (triggers network change events, crankd, etc) 251 | echo "show State:/Network/Global/IPv4" | scutil | awk '/PrimaryInterface/ {print $3}' 252 | Get the default network interface (en0, etc). 253 | echo '{"json":"obj"}' | python -mjson.tool 254 | Validate json object with pretty-print. 255 | fdesetup status 256 | Get status of filevault. 257 | find . -name .DS_Store -exec rm -f {} \; 258 | Delete .DS_Store files. 259 | find . -type f -size +1G -exec rm {} + 260 | Find files larger than 1GB and delete them. 261 | find . -type f 2>/dev/null | while read A; do md5 -q $A 2>/dev/null; done | uniq -d 262 | Check for duplicate files in the current directory. 263 | find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' 264 | Show App Store apps. 265 | find foo -name bar -type f -exec rm -rf "{}" \; 266 | search directory foo for files named bar and delete them. 267 | for i in $(microdnf repoquery --installed); do if rpm -ql $i |grep -q /opt/homebrew; then echo $i; fi; done 268 | Search microdnf for rpms that install into /opt/homebrew. 269 | for i in ~/.ssh/*.pub; do ssh-keygen -l -f "$i"; done 270 | Check ssh key finderprint. 271 | fs_usage -e -www 272 | More detailed fs_usage output. 273 | getconf DARWIN_USER_DIR 274 | Return the directory where certain user settings such as notification center prefs are stored. 275 | git clone git@github.com:username/repo_name.wiki.git 276 | Clone a github wiki. 277 | git commit --amend 278 | f the commit you want to squash into is the last commit, you can even directly add new changes to it by using the --amend flag when committing. 279 | git diff --name-status 280 | Finding which files differ (instead of what differs inside files). 281 | git diff --word-diff 282 | Diff by highlighting inline word changes instead of whole lines. 283 | git gc 284 | Compress and clean up the repo. 285 | git log --grep=[search term] 286 | Search commit logs. 287 | git log --oneline --decorate 288 | Show branches and tags in a simple git log. 289 | git log --pretty=format:'%C(yellow)%h%C(reset) %s %C(cyan)%cr%C(reset) %C(blue)%an%C(reset) %C(green)%d%C(reset)' --graph --date-order 290 | Print out a readable git log. 291 | git rebase -i HEAD~2 292 | Squash the last two commits into one, useful for fixing silly errors. 293 | git reset 294 | Un-stages files staged for commits ONLY, so all your changes are still there. 295 | git reset --hard 296 | Cear all un-committed changes and revert back all your files to the state reflected by your last commit. DESTRUCTIVE. 297 | git reset --hard HEAD~2 298 | Delete a commit forever and ever. 299 | git show :/^Merge 300 | Shows the last merge commit. 301 | git show :/fix 302 | Show the last commit with the string 'fix'. 303 | git status -sb 304 | Show short status output in git. 305 | grep "\s69/" /etc/services 306 | See what is running on a port, for example, port 69. 307 | hdiutil attach -noverify -noautofsck ~/Desktop/Backup\ copy.dmg -shadow 308 | Mount a damaged disk image, to attempt to recover data. 309 | hdiutil attach dmg -mountpoint /tmp/name -nobrowse -noverify -noautoopen 310 | Mount dmg hidden from view. 311 | hdiutil create -volname foo -fs HFS+ -size 10m foo.dmg 312 | Create a new disk image. 313 | history | awk '{print $2}' | awk 'BEGIN{FS="|"}{print $1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr 314 | Return a sorted list of your most used commands. 315 | ifconfig en1 down && ifconfig en1 up 316 | Renew DHCP lease. 317 | installer -showChoicesXML -pkg /path/to/foo.pkg 318 | Display the showChoicesXML information for a given package. 319 | ioreg -c IOPlatformExpertDevice -d 2 |awk '/IOPlatformSerialNumber/ {print $3}' |sed s/\"//g 320 | Get serial number of current Mac. 321 | ioreg -c IOPlatformExpertDevice -d 2 |awk '/IOPlatformUUID/ {print $3}' |sed s/\"//g 322 | Get uuid of the current Mac. 323 | ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState 324 | Determine if Mac is in clamshell mode. 325 | ioreg -w 0 -c IOPlatformDevice -d 4 | awk -F '" = <"|">$' '/product-name/ {print $2}' 326 | Return the Product (Marketing) Name of the mac model. 327 | iostat -d disk0 328 | Display device io statistics. 329 | ipconfig getifaddr en0 330 | Get IP address for en0. 331 | ipconfig getoption en0 domain_name_server 332 | Get the DNS server for en0. 333 | ipconfig getoption en0 subnet_mask 334 | Get subnet mask for en0. 335 | ipconfig getpacket en0 336 | Get DHCP information for en0. 337 | ipconfig set en1 BOOTP && ipconfig set en1 DHCP 338 | Renew DHCP lease. 339 | jamf killJAMFHelper 340 | Kill the JAMFHelper process in a script. 341 | kextload -b foo 342 | Load kernel extension. 343 | kextstat -l 344 | List status of loaded kernel extensions. 345 | kextunload -b 346 | Unload kernel extension. 347 | killall ControlStrip 348 | Restart the Touch Bar Control Strip dingus. 349 | killall cfprefsd 350 | Restart the cfprefsd process. 351 | kmutil clear-staging 352 | Clear the contents of the staging directory /Library/StagedExtensions. 353 | kmutil inspect 354 | Lists all currently installed kernel extensions according to their collection. 355 | kmutil trigger-panic-medic --volume-root /Volumes/Macintosh\ HD 356 | Clear out all registered KEXTS while booted to RecoveryOS. 357 | kmutil unload -p /path/kextname.kext 358 | Unloads the kernel extension specified by /path/kextname.kext. This terminates and unloads it, but may not remove the original kernel extension or a staged copy. 359 | launchctl asuser <user> /bin/launchctl load /Library/LaunchAgents/com.foo.launchagent.plist 360 | Enable a launchagent as a user when run as root (deprecated in 10.10). 361 | launchctl bootout gui/<UID> /Library/LaunchAgents/com.foo.launchagent.plist 362 | Unload a LaunchAgent in the GUI domain (10.11 and up). 363 | launchctl bootstrap gui/<UID> /Library/LaunchAgents/com.foo.launchagent.plist 364 | Load a LaunchAgent giving the full path to the service plist (10.10 and up). 365 | launchctl bootstrap gui/<UID>/<service-name> 366 | Load a LaunchAgent in the GUI domain, passing the service name (10.10 and up). 367 | launchctl bootstrap system/<service-name> /Library/LaunchAgents/com.foo.launchagent.plist 368 | Load a LaunchDaemon as root (10.10 and up). 369 | launchctl bootstrap user/<UID>/<service-name> /Library/LaunchAgents/com.foo.launchagent.plist 370 | Load a LaunchAgent in the user domain, passing the service name (10.10 and up). 371 | launchctl disable gui/<UID>/com.foo.launchagent 372 | Disable a LaunchAgent in the GUI user space (10.10 and up). Process will not load again until it's enabled. 373 | launchctl kill SIGKILL gui/<UID>/com.foo.launchagent 374 | Kill a launchd service or agent. Example sigs: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html 375 | launchctl list 376 | List daemons and agents (deprecated in 10.10). 377 | launchctl load -w /Library/LaunchDaemons/com.foo.launchdaemon.plist 378 | Enable and load a LaunchDaemon (deprecated in 10.10). 379 | launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist 380 | configure apache to start at load 381 | launchctl load /Library/LaunchDaemons/com.foo.launchdaemon.plist 382 | Load a LaunchDaemon (deprecated in 10.10). 383 | launchctl print gui/<UID> 384 | List info about daemons and agents (10.10 and up). 385 | launchctl print gui/<UID>/com.foo.launchagent 386 | Print info about a specific LaunchAgent (10.10 and up). 387 | launchctl print system 388 | List info about root level services (10.10 and up). 389 | launchctl reboot -s system 390 | Reboot into single-user mode. 391 | launchctl reboot halt 392 | Shut down system immediately (10.10 and up). 393 | launchctl reboot logout 394 | Kill the GUI login session, suppressing any modal dialogs to block logout. 395 | launchctl reboot system 396 | Reboot system immediately (10.10 and up). 397 | launchctl reboot userspace 398 | Reconstruct user domain (simulates a reboot) (10.10 and up). 399 | launchctl stop com.apple.softwareupdated && launchctl start com.apple.softwareupdated 400 | Restart the softwareupdated process 401 | launchctl unload -w /Library/LaunchDaemons/com.foo.launchdaemon.plist 402 | Disable and unload a LaunchDaemon (deprecated in 10.10). 403 | launchctl unload /Library/LaunchDaemons/com.foo.launchdaemon.plist 404 | Unload a LaunchDaemon (deprecated in 10.10). 405 | less +F 406 | Similar to tail -f, but can ctrl-c out to vim mode. 407 | ln -s original link 408 | Create a symlink. 409 | log show --info --debug --predicate '(process == "dasd") && (eventMessage CONTAINS[cd] "com.apple.SoftwareUpdate") && (eventMessage CONTAINS[cd] "PolicyWeight")' 410 | Return logs for CoreDuet decisions regarding softwareupdate. 411 | log show --info --debug --predicate '(process IN { "configd", "Setup Assistant" }) || (process == "mDNSResponder" && subsystem == "com.apple.mdns" AND category == "resolver")' 412 | Return logs regarding DNS resolution during setup assistant 413 | log show --info --debug --predicate '(subsystem == "com.apple.powerd" && eventMessage CONTAINS[cd] "Battery capacity") || (subsystem == "com.apple.powerd" && category = "sleepWake" && eventMessage CONTAINS[cd] "vm.darkwake_mode: 0 -> 1")' --last 3d --style compact 414 | Display logs relating to battery capacity and darkwake activity. 415 | log show --info --debug --predicate '(subsystem == "com.apple.remotemanagementd" || subsystem == "RemoteManagement") || processImagePath CONTAINS[cd] "RemoteManagement.framework"' 416 | Show logs for DDM. 417 | log show --info --debug --predicate 'process = "airportd" && subsystem == "com.apple.WiFiManager" && eventMessage CONTAINS[cd] "Successfully associated to Wi-Fi network"' 418 | Log command to show when a wifi network was joined. 419 | log show --info --debug --predicate 'process == "SoftwareUpdateNotificationManager" && eventMessage CONTAINS[cd] "SUOSURestartCountdownOperation"' 420 | Return logs for softwareupdate countdown notifications. 421 | log show --info --debug --predicate 'process == "apsd" && subsystem == "com.apple.apsd"' 422 | Return logs related to APNs (Apple Push Notification System). 423 | log show --info --debug --predicate 'process == "cfprefsd" && eventMessage CONTAINS[cd] "wrote the key"' 424 | Inspect cfprefsd to determine changed preferences in progress. 425 | log show --info --debug --predicate 'process == "com.apple.MobileSoftwareUpdate.UpdateBrainService" && eventMessage CONTAINS[cd] "SEP command" && !(eventMessage CONTAINS[cd] "returned 0")' 426 | Return logs for softwareupdate and boot policy errors (secure enclave aka sep). 427 | log show --info --debug --predicate 'process == "loginwindow" && subsystem == "com.apple.login"' 428 | Return logs related to user login. 429 | log show --info --debug --predicate 'process == "mdmclient" && category == "HTTPUtil" && eventMessage CONTAINS[cd] "BootstrapToken"' 430 | Return logs for mdmclient requesting the bootstraptoken. 431 | log show --info --debug --predicate 'process == "mdmclient" && category == "HTTPUtil"' 432 | Return logs for mdmclient communicating with the server. 433 | log show --info --debug --predicate 'process == "mdmclient" && eventMessage CONTAINS[cd] "BootstrapToken"' 434 | Return logs related to bootstraptoken requests via mdmclient. 435 | log show --info --debug --predicate 'process == "mdmclient" && eventMessage CONTAINS[cd] "Fetching asset"' 436 | Show logs for DDM service configs and asset downloads. 437 | log show --info --debug --predicate 'process == "mdmclient" && eventMessage CONTAINS[cd] "MDM Requested"' 438 | Return logs for softwareupdate commands initiated by MDM. 439 | log show --info --debug --predicate 'process == "mdmclient" && eventMessage CONTAINS[cd] "Processing server request"' 440 | Return logs for all commands initiated by MDM. 441 | log show --info --debug --predicate 'process == "mdmclient" && subsystem == "com.apple.ManagedClient"' 442 | Return logs related to mdmclient (ManagedClient). 443 | log show --info --debug --predicate 'process == "mobileactivationd" && subsystem == "com.apple.MobileActivation"' 444 | Return logs related to mobileactivationd (Activation Lock, DEP Enrollment). 445 | log show --info --debug --predicate 'process == "opendirectoryd" && subsystem IN { "com.apple.opendirectoryd", "com.apple.AccountPolicy" }' 446 | Return logs related to Open Directory. 447 | log show --info --debug --predicate 'process == "pythonprompt" && eventMessage CONTAINS[cd] "Showing alert"' 448 | Return logs that trigger the python deprecation prompt. 449 | log show --info --debug --predicate 'process == "softwareupdated" && (eventMessage BEGINSWITH "SU Background" || eventMessage BEGINSWITH "SU Foreground")' 450 | Return logs for background or foreground scan operations. 451 | log show --info --debug --predicate 'process == "softwareupdated" && (subsystem == "com.apple.SoftwareUpdateMacController" && category == "SU" && eventMessage CONTAINS[cd] "Sending event" && eventMessage CONTAINS[cd] "ota") || (subsystem == "com.apple.MobileSoftwareUpdate" && category == "Info" && eventMessage CONTAINS[cd] "updateFinished")' 452 | Return logs about softwareupdate focused on MSU/OTA activity. 453 | log show --info --debug --predicate 'process == "softwareupdated" && subsystem IN { "com.apple.SoftwareUpdate", "com.apple.mac.install", "com.apple.SoftwareUpdateMacController", "com.apple.mobileassetd" }' 454 | Return logs related to softwareupdated and Software Update. 455 | log show --info --debug --predicate 'process == "sudo" || eventMessage CONTAINS[cd] "sudo"' 456 | Return logs pertaining to processes run with sudo. 457 | log show --info --debug --predicate 'process == "syspolicyd" && subsystem == "com.apple.syspolicy.exec"' 458 | Return logs related to Gatekeeper. 459 | log show --info --debug --predicate 'process IN { "CertificateService", "mdmclient" }' 460 | Return logs about mdmclient and the scep exchange 461 | log show --info --debug --predicate 'process IN { "softwareupdated", "mdmclient" } || subsystem IN { "com.apple.SoftwareUpdateMacController", "com.apple.MobileSoftwareUpdate", "com.apple.SoftwareUpdate" }' 462 | Return logs for softwareupdated or mdmclient processes including related subsystems. 463 | log show --info --debug --predicate 'subsystem == "com.apple.AppSSO"' 464 | Show PlatformSSO logs 465 | log show --info --debug --predicate 'subsystem == "com.apple.AssetCache"' 466 | Return logs related to Apple Content Caching. 467 | log show --info --debug --predicate 'subsystem == "com.apple.CryptoTokenKit"' 468 | Return logs pertaining to CryptoTokenKit. 469 | log show --info --debug --predicate 'subsystem == "com.apple.ManagedClient" && category == "OSUpdate"' 470 | Return logs regarding MDM software update commands (e.g. InstallASAP) 471 | log show --info --debug --predicate 'subsystem == "com.apple.ManagedClient" && eventMessage CONTAINS[cd] "Acknowledged"' 472 | Return logs regarding mdmclient responses to push notifications. 473 | log show --info --debug --predicate 'subsystem == "com.apple.ManagedClient" && eventMessage CONTAINS[cd] "Canceled"' 474 | Return logs regarding mdmclient failed responses to push notifcations. 475 | log show --info --debug --predicate 'subsystem == "com.apple.ManagedClient" && eventMessage CONTAINS[cd] "Installed configuration profile:"' 476 | Log command to show local installation of config profiles. 477 | log show --info --debug --predicate 'subsystem == "com.apple.ManagedClient"' 478 | Return logs pertaining to ManagedClient (MDM). 479 | log show --info --debug --predicate 'subsystem == "com.apple.MobileSoftwareUpdate" && category == "NRD" && logType == "error"' 480 | Return logs for softwareupdate regarding the RecoveryOS (showing errors). 481 | log show --info --debug --predicate 'subsystem == "com.apple.SoftwareUpdate" && category == "SoftwareUpdate"' 482 | Return logs for softwareupdate process and category. 483 | log show --info --debug --predicate 'subsystem == "com.apple.SoftwareUpdate" && process == "SoftwareUpdateNotificationManager" && eventMessage CONTAINS[cd] "SUOSUNotificationCenterDelegate"' 484 | Return logs for softwareupdate system notifications including user actions. 485 | log show --info --debug --predicate 'subsystem == "com.apple.SoftwareUpdate"' 486 | Return logs from Software Update process. 487 | log show --info --debug --predicate 'subsystem == "com.apple.SoftwareUpdateMacController" && eventMessage CONTAINS[cd] "CancellingScan"' 488 | Return logs for Software Update canceled scans. 489 | log show --info --debug --predicate 'subsystem == "com.apple.SoftwareUpdateMacController" && eventMessage CONTAINS[cd] "MSU_ERR_BOOTPOLICY"' 490 | Return logs for softwareupdate and boot policy errors (such as failing to cache the credentials). 491 | log show --info --debug --predicate 'subsystem == "com.apple.TCC" && eventMessage BEGINSWITH[cd] "AttributionChain"' 492 | Return logs for AttributionChain to determine the correct bundleidentifier to allowlist. 493 | log show --info --debug --predicate 'subsystem == "com.apple.TCC" AND eventMessage BEGINSWITH "AUTHREQ"' 494 | Return more verbose logs to determine look at tcc activity. 495 | log show --info --debug --predicate 'subsystem == "com.apple.TCC"' 496 | Return logs showing TCC events. 497 | log show --info --debug --predicate 'subsystem == "com.apple.XProtectFramework.PluginAPI" && category == "XPEvent.structured"' 498 | Return logs showing Xprotect events. 499 | log show --info --debug --predicate 'subsystem == "com.apple.backgroundtaskmanagement" && category == "mcx"' 500 | Return logs for Background Task Management aka btm aka ServiceManagement aka Login Items aka launchd 501 | log show --info --debug --predicate 'subsystem == "com.apple.backgroundtaskmanagement" && eventMessage CONTAINS[cd] "Posting managed item notification request"' 502 | Return logs pertaining to Managed Login Items (aka btm aka Background Task Management aka ServiceManagement) notifications. 503 | log show --info --debug --predicate 'subsystem == "com.apple.backgroundtaskmanagement"' 504 | Return logs regarding Login Items (aka btm aka Background Task Management aka ServiceManagement). 505 | log show --info --debug --predicate 'subsystem == "com.apple.duetactivityscheduler" && (eventMessage CONTAINS[cd] "softwareupdate" && eventMessage CONTAINS[cd] "DecisionToRun")' 506 | Return logs regarding CoreDuet (aka duetactivityscheduler) and if it has decided to run. 507 | log show --info --debug --predicate 'subsystem == "com.apple.duetactivityscheduler" && (eventMessage CONTAINS[cd] "softwareupdate" && eventMessage CONTAINS[cd] "Rescheduling XPC Activity")' 508 | Return logs regarding CoreDuet (aka duetactivityscheduler) and any rescheduled activities. 509 | log show --info --debug --predicate 'subsystem == "com.apple.duetactivityscheduler" && (eventMessage CONTAINS[cd] "softwareupdate" && eventMessage CONTAINS[cd] "Submitted Activity")' 510 | Return logs regarding CoreDuet (aka duetactivityscheduler) and submitted activity status. 511 | log show --info --debug --predicate 'subsystem == "com.apple.duetactivityscheduler" && eventMessage CONTAINS[cd] "softwareupdate"' 512 | Return logs for CoreDuet (aka Duet Activity Scheduler) and softwareupdate. 513 | log show --info --debug --predicate 'subsystem == "com.apple.mac.install" && category == "MacBuddyX"' 514 | Return logs for Setup Assistant progress. 515 | log show --info --debug --predicate 'subsystem == "com.apple.network" && category IN { "connection", "boringssl" }' 516 | Return logs related to Networking. 517 | log show --info --debug --predicate 'subsystem == "com.apple.networkextension"' 518 | Return logs regarding network extensions. 519 | log show --info --debug --predicate 'subsystem == "com.apple.remotemanagementd" && category == "statusPublisherDelegate"' 520 | Show logs for DDM software update status reports. 521 | log show --info --debug --predicate 'subsystem == "com.apple.securityd" && category == "ocsp"' 522 | Return logs related to OCSP (Certificate validity). 523 | log show --info --debug --predicate 'subsystem == "com.apple.sharing" && category == "AirDrop" && eventMessage CONTAINS[cd] "Discoverable mode changed"' 524 | Return logs related to AirDrop discoverable mode. 525 | log show --info --debug --predicate 'subsystem == "com.apple.sharing" && category == "AutoUnlock"' 526 | Return logs related to Apple Watch unlock (AutoUnlock). 527 | log show --info --debug --predicate 'subsystem == "com.apple.su" && category == "DDM"' --style compact 528 | Show logs for DDM software update. 529 | log show --info --debug --predicate 'subsystem == "com.apple.unc" && eventMessage CONTAINS[cd] "displaying"' 530 | Return logs for Notification Center notifications. 531 | log show --info --debug --predicate 'subsystem == "com.apple.unc"' 532 | Return logs from Notification Center to determine the correct bundleidentifier to allowlist. 533 | log show --info --debug --predicate 'subsystem == "com.apple.xprotect"' 534 | Return logs related to XProtect. 535 | log show --info --debug --predicate 'subsystem == "com.cisco.anyconnect.vpn" && category IN { "acvpnagent", "acvpnui", "acvpncli" }' 536 | Return logs showing more focused AnyConnect events. 537 | log show --info --debug --predicate 'subsystem == "com.cisco.anyconnect.vpn"' 538 | Return logs showing AnyConnect events. 539 | log show --info --debug --predicate 'subsystem == "com.github.macadmins.Nudge"' 540 | Return logs for Nudge. 541 | log show --info --debug --predicate 'subsystem == "com.grahamgilbert.crypt"' 542 | Return logs for Crypt. 543 | log show --info --debug --predicate 'subsystem IN { "com.apple.SoftwareUpdateMacController", "com.apple.MobileSoftwareUpdate", "com.apple.SoftwareUpdate" }' 544 | Return logs for Software Update subsystems. 545 | log stream --info --debug --predicate 'subsystem == "com.apple.su" && category == "DDM" && eventMessage CONTAINS[cd] "reporting status"' 546 | Return logs showing DDM software update status reports. 547 | logger -is 548 | Log the process id and message to stderr and syslog. 549 | lpadmin -p "$printer_name" -o printer-is-shared=false 550 | Disable printer sharing for a printer. 551 | ls -l |grep *.pdf |wc -l 552 | Count the number of files in the current working directory, for example PDF files. 553 | ls -l |grep ^- |wc -l 554 | Count the number of regular files in the current working directory. 555 | ls -l |grep ^d |wc -l 556 | Count the number of directories in the current working directory. 557 | ls /usr/{,local}/{,s}bin/foo 558 | Use brackets to list files in four different directories in the same tree. 559 | lsbom -p UGMsF /var/db/receipts/foo.pkg.bom 560 | Print the bill of materials for a package. 561 | lsof -P -i -n | cut -f 1 -d " " | uniq 562 | Display a list of all of the applications which have connected to the Internet. 563 | lsof -n -i4TCP 564 | List all ports. 565 | lsof -n -i4TCP |grep LISTEN 566 | List all ports that are listening on a host. 567 | lsof | awk '/.Trash\//{print $2}' | xargs kill 568 | Kill the lingering process that is preventing emptying the trash. 569 | macosguest.forceRecoveryModeInstall = "TRUE" 570 | Add this to your vmx file to boot VM to recovery. 571 | man diskutil | col -bx > /path/to/diskutil.txt 572 | Export manpage to a text file, with formatting. 573 | mdfind -live foo 574 | Spotlight search, updating in real time. 575 | mdfind -name foo 576 | Spotlight search, matching filenames only. 577 | mdfind -onlyin ~/Documents foo 578 | restrict search to a single directory. 579 | mdfind foo 580 | Run spotlight from cli. 581 | mdls -name kMDItemFSCreationDate /path/to/foo |awk -F' = ' '{print $2}' 582 | Return the creation date of a file. 583 | mdls -name kMDItemLastUsedDate /Applications/Safari.app 584 | Check the last time an app was used. 585 | mdmclient QueryInstalledProfiles 586 | Return information about configuration profiles. 587 | mdutil -E 588 | erase spotlight index and rebuild it from scratch. 589 | mdutil -a -i off 590 | Turn spotlight off. 591 | mdutil -d / 592 | Disable spotlight for volume. 593 | mdutil -i off 594 | turn off spotlight indexing. 595 | mdutil -s / 596 | Check status of spotlight. 597 | mkdir -p foo/{bar,baz} 598 | Make multiple directories in one go. 599 | mktemp -d /tmp/foo.XXXX 600 | Create a temporary directory. 601 | mount_smbfs //'domain;username'@foo.domain.com/bar /Volumes/bar 602 | Mount SMB share using domain credentials. 603 | nc -v -w 15 www.google.com 80 604 | Print out info about a network connection, with a defined timeout. 605 | nc -v www.google.com 80 606 | Print out info about a network connection. 607 | netstat -I en0 -b |tail -1 |awk '{print $10}' 608 | Print the network output in byes. 609 | netstat -I en0 -b |tail -1 |awk '{print $7}' 610 | Print the network input in bytes. 611 | netstat -i 612 | Show interfaces. 613 | netstat -n |grep 5900 614 | See open ARD connections. 615 | netstat -nr 616 | Print routing table. 617 | netstat -nr |grep -m 1 -iE 'default|0.0.0.0' |awk '{print $2}' 618 | Get subnet mask for primary interface. 619 | netstat -nr |grep -m 1 -iE 'default|0.0.0.0' |awk '{print $6}' 620 | Get primary interface device. 621 | netstat -p udp 622 | Show stats for one protocol. 623 | netstat -s 624 | Show per-protocol stats. 625 | nettop -m route 626 | Show network route table. 627 | networksetup -listallhardwareports 628 | Print out network service names, device, and ports. 629 | networksetup -listallnetworkservices 630 | Print out network service names. 631 | networksetup -ordernetworkservices 'Wi-Fi' 'USB Ethernet' 632 | Change network interface order. 633 | networksetup -printcommands 634 | List out all networksetup subcommands. 635 | networksetup -setdhcp Wi-Fi 636 | Set an interface to DHCP. 637 | networksetup -setdnsservers Wi-FI 10.0.0.2 10.0.0.3 638 | Set DNS servers explicitely. 639 | networksetup -setmanual Wi-Fi 10.0.0.2 255.255.255.0 10.0.0.1 640 | Configure IP, subnet, and gateway. 641 | networksetup -setnetworkserviceenabled off 642 | Disable a network service. 643 | networksetup -setsearchdomains INTERFACE empty 644 | Use 'empty' to clear the manually-set search domains' 645 | nscurl --ats-diagnostics --verbose https://example.com 646 | Display ATS diagnostic for URL. 647 | nvram -p 648 | Display all nvram variables. 649 | nvram internet-recovery-mode=DiagsModeDisk 650 | Boot to Local Apple Hardware Diagnostic (D) 651 | nvram internet-recovery-mode=DiagsModeNetwork 652 | Boot to Internet/AST diagnostic (OPT-D) 653 | nvram internet-recovery-mode=RecoveryModeDisk 654 | Boot to Recovery (CMD-R) 655 | nvram internet-recovery-mode=RecoveryModeNetwork 656 | Boot to Internet Recovery (CMD-OPT-R) 657 | nvram recovery-boot-mode=unused 658 | Reboot into recovery mode. 659 | odutil set log debug 660 | Set debug log for opendirectoryd. 661 | odutil show nodenames 662 | Show offline connections. 663 | open "x-apple.systempreferences:com.apple.preferences.softwareupdate?client=bau&installMajorOSBundle=com.apple.InstallAssistant.Mojave" 664 | Download Mojave beta. 665 | open 'x-apple.systempreferences:com.apple.Software-Update-Settings.extension?action=showBetaUpdates' 666 | Open the hidden system settings beta pane. 667 | open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app 668 | Start screensaver. 669 | open macappstore://showUpdatesPage 670 | Launch the Mac App Store and load the updates pane. 671 | openssl enc -aes-256-cbc -d -in foo.enc -out foo.decrypted 672 | Decrypt a file encrypted with openssl. 673 | openssl enc -aes-256-cbc -salt -in foo -out foo.enc 674 | Encrypt a file with a password. 675 | openssl sha1 /path/to/foo.dmg 676 | Verify the SHA1 digest of a downloaded file, such as an update from Apple support. 677 | openssl smime -inform DER -verify -in signed.mobileconfig -noverify -out unsigned.mobileconfig 678 | Convert a signed (binary) mobileconfig AKA configuration profile. 679 | openssl x509 -checkend 0 -noout -in /path/to/cert.pem 680 | Check validity of a cert. 681 | openssl x509 -noout -enddate -in /path/to/cert.pem 682 | Get NotAfter of cert using openssl. 683 | openssl x509 -noout -startdate -in /path/to/cert.pem 684 | Get NotBefore of cert using openssl. 685 | openssl x509 -noout -subject -in /path/to/cert.pem 686 | Get CN out of cert using openssl. 687 | osascript -e 'set volume output muted true' 688 | Mute the volume using applescript. 689 | osqueryi "select identifier, state from system_extensions;" 690 | Use osquery to return system extension state. 691 | osqueryi --disable_extensions --disable_events --flagfile= 692 | Run osquery without debug output. 693 | perl -i -pe's/\r$//;' foo 694 | Change windows (DOS) style line endings to unix. 695 | pgrep Chrome | wc -l 696 | See processes by a specific app, for example Chrome. 697 | pgrep Safari 698 | Get the process of a running app. 699 | pkgutil --check-signature /path/to/pkg 700 | Check signature of package (pkg) installer. 701 | pkgutil --file-info /path/to/file 702 | See which package installed a file or binary. 703 | pkgutil --files pkg-id 704 | Show all files installed by pkg-id. 705 | pkgutil --forget pkg-id 706 | Remove receipts to trigger re-install of package. 707 | pkgutil --pkg-info pkg-id 708 | Print extended info about pkg-id. 709 | pkgutil --pkgs 710 | List all installed package IDs (use -volume to use a different volume than boot). 711 | pkill Safari 712 | Kill the process of a running app. 713 | plutil -convert binary1 bar.plist 714 | Convert an XML plist file to binary. 715 | plutil -convert xml1 foo.plist 716 | Convert a binary plist to XML format for editing. 717 | plutil -lint /Library/Preferences/com.apple.loginwindow.plist 718 | Check plist for errors. 719 | plutil -p /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/Resources/attributions.plist 720 | Print Login Items (aka btm aka Background Task Management aka ServiceManagement) default apple-provided attributions. 721 | pmset -g 722 | See all current power management settings. 723 | printenv 724 | Print all environment variables. 725 | printf '\xf0\x9f\x92\xa9\n' 726 | Print poo emoji (hat tip https://twitter.com/macmuleblog/status/581452235617484800). 727 | profiles -D 728 | Remove all profiles. 729 | profiles -I -F /path/to/profile 730 | Manually install profile. 731 | profiles -L 732 | See user profiles. 733 | profiles -P 734 | See all profiles, aggregated. 735 | profiles renew -type enrollment 736 | Trigger DEP enrollment prompt. 737 | profiles status -type enrollment 738 | Determine if a machine is enrolled in MDM, and if UAMDM. 739 | ps -A -o pid,nice,command 740 | Prints a process list including the nice value. 741 | ps ax | grep <PID> | grep Z | wc -l 742 | Show zombie processes. 743 | ps lauxww 744 | Include the parent process (ppid) in the output. 745 | pwpolicy -u foo -setpolicy "newPasswordRequired=1" 746 | Require a new password for local user foo. 747 | pydoc -g 748 | Open python docs in a browser. 749 | python -c "from Foundation import CFPreferencesCopyAppValue ; print CFPreferencesCopyAppValue('CatalogURL', 'com.apple.SoftwareUpdate')" 750 | Return the current Software Update preferences. 751 | python -c "import site; print site.getsitepackages()" 752 | Display the site-packages directories used by python. 753 | python -c 'import this' 754 | Print the Zen of Python. 755 | python -m SimpleHTTPServer 8000 756 | Run a simple python webserver. 757 | qlmanage -p foo 758 | Invoke QuickLook from the command line. 759 | route -n add 10.0.0.0/32 10.0.9.2 760 | Add a route for a network to use a specific device. 761 | rsync -avPE src host:dest 762 | rsync Mac OS file attributes. 763 | ruby -e 'key = [125, 137, 82, 35, 210, 188, 221, 234, 163, 185, 31]; IO.read("/etc/kcpassword").bytes.each_with_index { |b, i| print [b ^ key[i % key.size]].pack("U*") }' 764 | Reverse password from kcpassword file. 765 | screencapture -C -M image.png 766 | capture contents of the screen and attach to a mail message. 767 | screencapture -C screenshot.png 768 | Capture screen and save to a file. 769 | screencapture -c -W 770 | capture window using mouse, without drop shadow and copy to clipboard. 771 | screencapture -s -t pdf image.pdf 772 | select a portion of the screen with the mouse and save as a pdf. 773 | scutil --dns 774 | Prints the current dns configuration. 775 | scutil -r foo 776 | Check if host 'foo' is reachable. 777 | scutil <<< "show State:/Network/Global/IPv4" 778 | Print state of the primary network interface (IPv4). 779 | scutil <<< "show State:/Network/Global/IPv6" 780 | Print state of the primary network interface (IPv6). 781 | scutil <<< "show State:/Network/Service/com.cisco.anyconnect/IPv4" 782 | Print the state of the VPN interface (AnyConnect) over IPv4. 783 | scutil <<< "show State:/Network/Service/com.cisco.anyconnect/IPv6" 784 | Print the state of the VPN interface (AnyConnect) over IPv6. 785 | scutil <<< 'list' 786 | Show the list of options in scutil. 787 | security cms -D -i signed.mobileconfig 788 | Read a signed (binary) mobileconfig AKA configuration profile. 789 | sed '/^$/d' file.txt 790 | Remove empty lines from a file (via http://krypted.com/mac-os-x/remove-empty-lines-from-a-file/) 791 | sed -e 's/\([0-9A-Fa-f]\{2\}\)/\1:/g' -e 's/\(.*\):$/\1/' foo.txt 792 | Convert a list of MAC addresses to include colons. 793 | serverinfo --buildversion 794 | Returns the build version of Server.app. 795 | serverinfo --configured 796 | See if the Server.app assistant has been run. 797 | serverinfo --hardware 798 | Check if the machine is running OS X Server. 799 | serverinfo --plist 800 | Output Server.app config to xml. 801 | serverinfo --prefix 802 | Show server root. 803 | serverinfo --shortversion 804 | Returns the short version no. of Server.app. 805 | serverinfo --software 806 | See if Server.app is installed. 807 | sfltool dumpbtm 808 | Lists information about login items | background tasks | service management 809 | sfltool list -d com.apple.LSSharedFileList.SessionLoginItems 810 | Show items configured to Open at Login. 811 | softwareupdate --fetch-full-installer --full-installer-version 12.2 812 | Download the full installer with softwareupdate. 813 | spctl -a -t exec -vv /Applications/Foo.app 814 | Check to see if an app is allowed with Gatekeeper. 815 | spctl -a -t install -vv /path/to/pkg 816 | Check to see if a package installer is signed. 817 | sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent' 818 | Delete history of files with the quarantine bit (i.e. files that have been downloaded). 819 | sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | sort 820 | Show a full list of files with the quarantine extended attribute (i.e. files that have been downloaded). 821 | ssh -K -L5900:127.0.0.1:5900 user@server 822 | Use an ssh tunnel. 823 | ssh -o PreferredAuthentications="password" user@host 824 | Bypass key-based auth, useful for testing your password. 825 | ssh -t username@server 'foo' 826 | Run command 'foo' on remote server. 827 | stat -f%Su /dev/console 828 | Get currently logged in user. 829 | stat -f%u /dev/console 830 | Get the currently logged in user's uid. 831 | stat -x /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist | awk -F': ' '/Modify/ {print $2,$3,$4,$5,$6}' 832 | Get the modification date of the XProtect plist (when it was last updated). 833 | stat -x foo 834 | Get info on a file. 835 | sudo "/Applications/Cisco/Cisco AnyConnect Socket Filter.app/Contents/MacOS/Cisco AnyConnect Socket Filter" -deactivateExt 836 | Unload the AnyConnect system network extension. 837 | sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /path/to/media --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction 838 | Create Mavericks install media. 839 | sudo /Applications/Santa.app/Contents/MacOS/Santa --unload-system-extension 840 | Unload the santa system extension. 841 | sudo /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user 842 | Reset launch services database. 843 | sudo /usr/local/bin/mdatp system-extension network-filter disable 844 | Disable MDE network extension. 845 | sudo chflags nouchg foo 846 | Remove immutable attribute flag, similar to chattr in linux. 847 | sudo chflags uchg foo 848 | Make a file immutable, similar to chattr in linux. 849 | sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true 850 | Set system to mount secondary or external drives at the login screen. Useful for headless systems. 851 | sudo defaults write /Library/Preferences/com.apple.loginwindow PasswordExpirationDays 0 852 | Turn off OS warning for password expirations. 853 | sudo dscacheutil -flushcache 854 | Reset the DNS cache (10.6). 855 | sudo fdesetup authrestart 856 | Bypass filevalut pre-boot loginwindow. 857 | sudo fs_usage -e -f filesystem | grep -v CACHE_HIT | grep -v grep | grep open 858 | List files as they are being opened. 859 | sudo fs_usage -e -f filesystem | grep -v CACHE_HIT | grep -v grep | grep write 860 | List files as they are being written to disk. 861 | sudo fs_usage -f network Safari 862 | List network related events. 863 | sudo fs_usage Finder 864 | Watch Finder activity. 865 | sudo iotop 866 | Part of dtrace, presents a top-like listing. On a sluggish machine, one could track the drive activity to determine what was slowing a system down. 867 | sudo killall -HUP mDNSResponder 868 | Reset the DNS cache (10.7+). 869 | sudo launchctl kickstart -k system/com.apple.softwareupdated 870 | Kickstart the softwareupdate process. 871 | sudo launchctl procinfo <PID> |grep responsible 872 | Find the responsible process for a child process (useful for TCC/PPPC). 873 | sudo launchctl setenv CFNETWORK_DIAGNOSTICS 3 874 | Enable network diagnostic logging in macOS (change back to 0 to reset; requires a reboot). 875 | sudo log config --subsystem com.apple.backgroundtaskmanagement --mode persist:debug 876 | Set the Login Items (aka backgroundtaskmanagement aka btm aka ServiceManagement) debug logs to be retained. 877 | sudo mdutil -E /Volumes/foo 878 | Force spotlight index to be rebuilt. 879 | sudo nvram boot-args="-v" 880 | Turn on verbose boot. 881 | sudo nvram boot-args="-x -v" 882 | Boot into Safe Mode and Verbose Mode simultaneously. 883 | sudo opensnoop -f /etc/passwd 884 | Watch a file. 885 | sudo opensnoop -n Finder 886 | Watch files being opened by a process. 887 | sudo opensnoop -p PID 888 | Watch a process. 889 | sudo osascript -e 'set volume 10' 890 | Max out the volume using applescript. 891 | sudo pkill -U user Foo 892 | Kill specific process by name 'Foo'. 893 | sudo plutil -p /Library/Application\ Support/com.apple.TCC/MDMOverrides.plist 894 | List out the current PPPC settings locally. 895 | sudo pmset -a hibernatemode 0 896 | Disable safe sleep mode. If you want safe sleep mode back, just change the '0' to a '3'. 897 | sudo route -n flush && sudo networksetup -setv4off Wi-Fi && sudo networksetup -setdhcp Wi-Fi 898 | Flush routing table and reset network device. 899 | sudo rwsnoop -p PID 900 | Part of dtrace, observes read and writes at the application level. Very verbose, and hooked into the kernel, so very accurate. 901 | sudo scutil --set ComputerName foo 902 | Set the localhost and sharing name. 903 | sudo scutil --set HostName foo 904 | Set the localhost and sharing name. 905 | sudo scutil --set LocalHostName foo 906 | Set the localhost and sharing name. 907 | sudo sharing -a /Path/to/foo 908 | Share a directory from the command line (afp, smb, ftp). 909 | sudo sharing -e /Path/to/folder -g 000 910 | Turn off guest access to newly-created share. 911 | sudo sharing -r /Path/to/foo 912 | Turn off sharing entirely for a directory. 913 | sudo spctl --master-disable 914 | Disable Gatekeeper enforcement globally. 915 | sudo tail -40 -f /var/log/system.log 916 | Tail syslog with a buffer of 40 lines. 917 | sudo tcpdump -i pktap,all -w dns_$(date +%Y%m%d).pcap -s0 udp port 53 918 | Print network traffic to file (dns in this case). 919 | sudo xattr -r -d com.apple.quarantine /path/to/MyApp.app 920 | Remove the quarantine bit from downloaded apps. 921 | sudo xcrun cc 922 | License the Xcode command line utilities. 923 | sysadminctl -deleteUser foo 924 | Cleanly delete a user (alternative to using dscl). 925 | sysctl -n hw.model 926 | Return the hardware model identifier. 927 | sysdiagnose -f ~/Desktop/ 928 | Get system and performance report. 929 | syslog -k Time ge -24h | egrep -e 'sudo' 930 | Check syslog for sudo attempts in the last day. 931 | system_profiler -listDataTypes 932 | List all Data Types available in system_profiler. 933 | system_profiler SPHardwareDataType 934 | Print hardware information from system profiler. 935 | system_profiler SPPowerDataType | grep -i Cycle | awk -F: '{print $2}' 936 | Return battery cycle count. 937 | system_profiler SPSoftwareDataType |awk -F': ' '/Boot Volume/{print $2}' 938 | Show current boot drive. 939 | systemsetup -getstartupdisk 940 | Get current startup disk. 941 | systemsetup -liststartupdisks 942 | List available startup disks (via http://krypted.com/mac-security/dont-use-bless-to-change-startup-disks-any-more-in-os-x/) 943 | systemsetup -setremotelogin on 944 | Enable SSH. 945 | systemsetup -setstartupdisk /Volumes/MyMac 946 | Set startup disk (via http://krypted.com/mac-security/dont-use-bless-to-change-startup-disks-any-more-in-os-x/) 947 | tar cvfj foo.tar.bz2 ./foo 948 | Create a compressed archive. 949 | tar tvzf ./foo.tar.bz2 950 | List a compressed archive. 951 | tar xvfj ./foo.tar.bz2 952 | Uncompress an archive. 953 | tcpdump -nS 954 | Do a basic traffic capture. 955 | tcpdump -nnvvXS 956 | Print verbose traffic with data. 957 | tcpdump -nnvvXs 548 958 | Print verbose traffic, with port specified. 959 | tcpdump -nnvvXs 548 dst 10.0.0.2 960 | Print verbose traffic, with port and destination specified. 961 | tcpdump -nnvvXs 548 dst 10.0.0.2 -w /tmp/dump.pcap 962 | Print traffic to file. 963 | tcpdump -qns 0 -A -r /tmp/dump.pcap 964 | Read file into tcpdump. 965 | telnet towel.blinkenlights.nl 666 966 | Return a handy line from the BOFH Excuse Server. 967 | time python -c 'import socket; socket.getaddrinfo("google.com", 443, socket.AF_UNSPEC, socket.SOCK_STREAM)' 968 | Check latency for connecting to an address. 969 | time read 970 | Run a simple stopwatch. Press enter to stop. 971 | time read -t 60 972 | Run a simple timer, counting down N seconds. 973 | top -d -u -s 10 974 | Run top, showing changes since last refresh, delayed by 10 seconds. 975 | touch -t 202001010000 /path/to/file 976 | Edit the access and modify times of a file. 977 | touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress 978 | Trigger Command Line Tools install 979 | touch foo{bar,baz} 980 | Use brackets to create similarly named files. 981 | traceroute -d google.com 982 | Print verbose debugging info. 983 | traceroute -m 100 216.81.59.173 | awk '{print $2}' 984 | Traceroute the Star Wars crawl. 985 | traceroute -n google.com 986 | Ignore names. 987 | vm_stat -c 10 1 988 | Repeat memory stats 10 times. 989 | vm_stat 10 990 | This updates the list every 10 seconds. The last two columns (pageins and pageouts) indicate memory action. 991 | vmrun -T ws list 992 | List currently running VMs. 993 | wget -O /dev/null http://speedtest.wdc01.softlayer\.com/downloads/test10.zip 994 | Check broadband speed. 995 | while true ; do ps axcopid,command,%cpu | grep "foo " ; sleep 1 ; done 996 | Monitor the CPU usage of a process (trailing space will exclude foo_bar etc) 997 | while true; do sleep 0.2; dig +short AAAA iprofiles.apple.com; done 998 | Check if the network can connect to iprofiles over ipv6 to ipv4 translation. 999 | xartutil --erase-all 1000 | Delete the cryptokeys on disk. This will render the Mac unbootable. 1001 | 1002 | 1003 | --------------------------------------------------------------------------------