Difference between revisions of "Notes:macOS"

From musings of k8
Jump to navigation Jump to search
Line 1: Line 1:
 
Stuff for macOS and OS X
 
Stuff for macOS and OS X
  
{{Info|[2020-11-19] These notes aren't fully formatted yet as I've simply copied them from my personal notes. I'll fix them with time.}}
+
{{Info|[2020-11-19] These notes aren’t fully formatted yet as I’ve simply copied them from my personal notes. I’ll fix them with time.}}
  
# References
+
<span id="references"></span>
 +
= References =
  
 
http://serverfault.com/questions/7346/what-are-useful-command-line-commands-on-mac-os-x
 
http://serverfault.com/questions/7346/what-are-useful-command-line-commands-on-mac-os-x
  
# Keyboard Shortcut Symbols
+
<span id="keyboard-shortcut-symbols"></span>
 +
= Keyboard Shortcut Symbols =
  
[Back up and share text replacements on Mac](https://support.apple.com/guide/mac-help/back-up-and-share-text-replacements-on-mac-mchl2a7bd795/mac)
+
[https://support.apple.com/guide/mac-help/back-up-and-share-text-replacements-on-mac-mchl2a7bd795/mac Back up and share text replacements on Mac]
  
## Symbols
+
<span id="symbols"></span>
 +
== Symbols ==
  
 
Common symbols used by macOS.
 
Common symbols used by macOS.
  
| Description | Symbol | Note |
+
{|
| -------- | --- | --- |
+
!width="57%"| Description
| Apple   |  | ⌘-Option-K (works on a Mac, but might be different on other OSes)
+
!width="21%"| Symbol
| Command | ⌘
+
!width="21%"| Note
| Delete   | ⌫
+
|-
| Escape   | ⎋ / ␛
+
| Apple
| Fn-Down | ⇟
+
| 
| Fn-Left | ↖︎
+
| ⌘-Option-K (works on a Mac, but might be different on other OSes)
| Fn-Right | ↘︎
+
|-
| Fn-Up   | ⇞
+
| Command
| Option   | ⌥
+
| ⌘
| Power   | ⌽ | substitute as there isn't a good one; http://unicodepowersymbol.com/
+
|
| Return   | ⏎
+
|-
| Shift   | ⇧
+
| Delete
| Tab     | ⇥
+
| ⌫
 +
|
 +
|-
 +
| Escape
 +
| ⎋ / ␛
 +
|
 +
|-
 +
| Fn-Down
 +
| ⇟
 +
|
 +
|-
 +
| Fn-Left
 +
| ↖︎
 +
|
 +
|-
 +
| Fn-Right
 +
| ↘︎
 +
|
 +
|-
 +
| Fn-Up
 +
| ⇞
 +
|
 +
|-
 +
| Option
 +
| ⌥
 +
|
 +
|-
 +
| Power
 +
| ⌽
 +
| substitute as there isn’t a good one; http://unicodepowersymbol.com/
 +
|-
 +
| Return
 +
| ⏎
 +
|
 +
|-
 +
| Shift
 +
| ⇧
 +
|
 +
|-
 +
| Tab
 +
| ⇥
 +
|
 +
|}
  
## Accents
+
<span id="accents"></span>
 +
== Accents ==
  
 
Method 1: To type an accented or alternate version of a character, hold a key down until its alternate characters are displayed. (https://support.apple.com/en-us/HT201586)
 
Method 1: To type an accented or alternate version of a character, hold a key down until its alternate characters are displayed. (https://support.apple.com/en-us/HT201586)
Line 39: Line 85:
 
Method 3: Open Character Palette with Control-Command-Space. Find the desired character, then drag the character with the mouse into place to insert.
 
Method 3: Open Character Palette with Control-Command-Space. Find the desired character, then drag the character with the mouse into place to insert.
  
| Name       | Example | Shortcut + Char |
+
{|
| ---------- | ------- | -------- |
+
! Name
| Acute     | ó Ó     | Option-E, V
+
! Example
| Circumflex | ô Ô     | Option-I, V
+
! Shortcut + Char
| Grave     | ò Ò     | Option-\`, V
+
|-
| Tilde     | õ Õ     | Option-N, V (only works with a, n, and o)
+
| Acute
| Umlaut     | ö Ö     | Option-U, V
+
| ó Ó
 +
| Option-E, V
 +
|-
 +
| Circumflex
 +
| ô Ô
 +
| Option-I, V
 +
|-
 +
| Grave
 +
| ò Ò
 +
| Option-`, V
 +
|-
 +
| Tilde
 +
| õ Õ
 +
| Option-N, V (only works with a, n, and o)
 +
|-
 +
| Umlaut
 +
| ö Ö
 +
| Option-U, V
 +
|}
  
## Letters
+
<span id="letters"></span>
 +
== Letters ==
  
| Letter | Shortcut | Description |
+
{|
| ------ | -------- | ----------- |
+
! Letter
| å | Option-A |
+
! Shortcut
| ç | Option-C |
+
! Description
| ø | Option-O |
+
|-
| ß | Option-S | Eszett
+
| å
| æ | Option-'
+
| Option-A
 +
|
 +
|-
 +
| ç
 +
| Option-C
 +
|
 +
|-
 +
| ø
 +
| Option-O
 +
|
 +
|-
 +
| ß
 +
| Option-S
 +
| Eszett
 +
|-
 +
| æ
 +
| Option-
 +
|
 +
|}
  
## Math Symbols
+
<span id="math-symbols"></span>
 +
== Math Symbols ==
  
Approximately : (≈) Option-X
+
Approximately : (≈) Option-X Degree : (°) Shift-Option-8 Delta : (∆) Option-J Division : (÷) Option-/ GreaterOrEqual : (≥) Option-. Infinity : (∞) Option-5 Intergal : (∫) Option-B LessOrEqual : (≤) Option-, Micro : (µ) Option-M Ohm : (Ω) Option-Z PartialDerivative : (∂) Option-D PerMil : (‰) Shift-Option-R Pi : (π) Option-P Plus/Minus : (±) Shift-Option-= ProductPi : (∏) Shift-Option-P SquareRoot : (√) Option-V Sum : (∑) Option-W
Degree : (°) Shift-Option-8
 
Delta : (∆) Option-J
 
Division : (÷) Option-/
 
GreaterOrEqual : (≥) Option-.
 
Infinity : (∞) Option-5
 
Intergal : (∫) Option-B
 
LessOrEqual : (≤) Option-,
 
Micro : (µ) Option-M
 
Ohm : (Ω) Option-Z
 
PartialDerivative : (∂) Option-D
 
PerMil : (‰) Shift-Option-R
 
Pi : (π) Option-P
 
Plus/Minus : (±) Shift-Option-=
 
ProductPi : (∏) Shift-Option-P
 
SquareRoot : (√) Option-V
 
Sum : (∑) Option-W
 
  
## Punctuation
+
<span id="punctuation"></span>
 +
== Punctuation ==
  
Copyright : (©) Option+G
+
Copyright : (©) Option+G Dagger : (†) Option+T Dot : (•) Option+8 EmDash : (—) Option+Shift+- EnDash : (–) Option+- Paragraph : (¶) Option+7 Registered : (®) Option+R Section : (§) Option+6 Trademark : (™) Option+2
Dagger : (†) Option+T
 
Dot : (•) Option+8
 
EmDash : (—) Option+Shift+-
 
EnDash : (–) Option+-
 
Paragraph : (¶) Option+7
 
Registered : (®) Option+R
 
Section : (§) Option+6
 
Trademark : (™) Option+2
 
  
## General
+
<span id="general"></span>
 +
== General ==
  
Command-F2 : Act as external display on iMac
+
Command-F2 : Act as external display on iMac Command-Delete : Delete a file Command-Shift-3 : Capture screen Command-Shift-4 : Capture window with cursor selection Command-Shift-4 + Space : Capture window Command-Shift-5 : Record cropped window Command-Shift-5 + Space : Record a window Command-Shift-Q : Log out with confirmation Command-Shift-Option-Q : Log out without confirmation
Command-Delete : Delete a file
 
Command-Shift-3 : Capture screen
 
Command-Shift-4 : Capture window with cursor selection
 
Command-Shift-4 + Space : Capture window
 
Command-Shift-5 : Record cropped window
 
Command-Shift-5 + Space : Record a window
 
Command-Shift-Q : Log out with confirmation
 
Command-Shift-Option-Q : Log out without confirmation
 
  
## Documents
+
<span id="documents"></span>
 +
== Documents ==
  
| Key combination | Description                                                 |
+
{|
| ---------------- | ------------------------------------------------------------ |
+
!width="21%"| Key combination
| ⌘-B             | Boldface the selected text, or turn boldfacing on or off.   |
+
!width="78%"| Description
| ⌘-Option-C       | Copy Style: Copy the formatting settings of the selected item to the Clipboard. |
+
|-
| ⌘-D             | Select the Desktop folder from within an Open dialog or Save dialog. |
+
| ⌘-B
| ⌘-Control-D     | Show or hide the definition of the selected word.           |
+
| Boldface the selected text, or turn boldfacing on or off.
| ⌘-Option-F       | Go to the search field.                                     |
+
|-
| ⌘-I             | Italicise the selected text, or turn italics on or off.     |
+
| ⌘-Option-C
| ⌘-Option-I       | Show or hide the inspector window.                           |
+
| Copy Style: Copy the formatting settings of the selected item to the Clipboard.
| ⌘-L             | During software installation, show a log of actions.         |
+
|-
| ⌘-Shift-P       | Page setup: Display a window for selecting document settings. |
+
| ⌘-D
| ⌘-Shift-S       | Display the ave As dialog, or duplicate the current document. |
+
| Select the Desktop folder from within an Open dialog or Save dialog.
| ⌘-T             | Show or hide the Fonts window.                               |
+
|-
| ⌘-Option-T       | Show or hide a toolbar in the app.                           |
+
| ⌘-Control-D
| ⌘-U             | Underline the selected text, or turn underlining on or off. |
+
| Show or hide the definition of the selected word.
| ⌘-Option-V       | Paste Style: Apply the copied style to the selected item.   |
+
|-
| ⌘-Option-Shift-V | Paste and Match Style: Apply the style of the surrounding content to the item pasted within that content. |
+
| ⌘-Option-F
| ⌘-;             | Fix misspelled words in the document.                       |
+
| Go to the search field.
| ⌘-Shift-:       | Display the Spelling and Grammar window                     |
+
|-
| ⌘-⌫             | Select Delete or Don't Save in a dialog that contains a Delete or Don't Save button. |
+
| ⌘-I
 +
| Italicise the selected text, or turn italics on or off.
 +
|-
 +
| ⌘-Option-I
 +
| Show or hide the inspector window.
 +
|-
 +
| ⌘-L
 +
| During software installation, show a log of actions.
 +
|-
 +
| ⌘-Shift-P
 +
| Page setup: Display a window for selecting document settings.
 +
|-
 +
| ⌘-Shift-S
 +
| Display the ave As dialog, or duplicate the current document.
 +
|-
 +
| ⌘-T
 +
| Show or hide the Fonts window.
 +
|-
 +
| ⌘-Option-T
 +
| Show or hide a toolbar in the app.
 +
|-
 +
| ⌘-U
 +
| Underline the selected text, or turn underlining on or off.
 +
|-
 +
| ⌘-Option-V
 +
| Paste Style: Apply the copied style to the selected item.
 +
|-
 +
| ⌘-Option-Shift-V
 +
| Paste and Match Style: Apply the style of the surrounding content to the item pasted within that content.
 +
|-
 +
| ⌘-;
 +
| Fix misspelled words in the document.
 +
|-
 +
| ⌘-Shift-:
 +
| Display the Spelling and Grammar window
 +
|-
 +
| ⌘-⌫
 +
| Select Delete or Don’t Save in a dialog that contains a Delete or Don’t Save button.
 +
|}
  
Command–DownArrow : Move the insertion point to the end of the document.
+
Command–DownArrow : Move the insertion point to the end of the document. Command–Equal : performs the same function. Command–LeftArrow : Move the insertion point to the beginning of the current line. Command–LeftCurlyBracket : Left align. Command–RightArrow : Move the insertion point to the end of the current line. Command–RightCurlyBracket : Right align. Command–Shift–DownArrow : Select the text between the insertion point and the end of the document. Command–Shift–LeftArrow : Select the text between the insertion point and the beginning of the current line. Command–Shift–Minus : Decrease the size of the selected item. Command–Shift–Plus : Increase the size of the selected item. Command–Shift–QuestionMark : Open the Help menu. Command–Shift–RightArrow : Select the text between the insertion point and the end of the current line. Command–Shift–UpArrow : Select the text between the insertion point and the beginning of the document. Command–Shift–VerticalBar : Center align. Command–UpArrow : Move the insertion point to the beginning of the document. Control-A : Move to the beginning of the line or paragraph. Control-B : Move one character backward. Control-D : Delete the character to the right of the insertion point. Or use Fn-Delete. Control-E : Move to the end of a line or paragraph. Control-F : Move one character forward. Control-H : Delete the character to the left of the insertion point. Or use Delete. Control-K : Delete the text between the insertion point and the end of the line or paragraph. Control-L : Center the cursor or selection in the visible area. Control-N : Move down one line. Control-O : Insert a new line after the insertion point. Control-P : Move up one line. Control-T : Swap the character behind the insertion point with the character in front of the insertion point. Fn-Delete : Forward delete on keyboards that don’t have a Forward Delete key. Or use Control-D. Fn–DownArrow : Page Down: Scroll down one page. Fn–LeftArrow : Home: Scroll to the beginning of a document. Fn–RightArrow : End: Scroll to the end of a document. Fn–UpArrow : Page Up: Scroll up one page. Option-Delete : Delete the word to the left of the insertion point. Option–LeftArrow : Move the insertion point to the beginning of the previous word. Option–RightArrow : Move the insertion point to the end of the next word. Shift–DownArrow : Extend text selection to the nearest character at the same horizontal location on the line below. Shift–LeftArrow : Extend text selection one character to the left. Shift–Option–DownArrow : Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again. Shift–Option–LeftArrow : Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again. Shift–Option–RightArrow : Extend text selection to the end of the current word, then to the end of the following word if pressed again. Shift–Option–UpArrow : Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again. Shift–RightArrow : Extend text selection one character to the right. Shift–UpArrow : Extend text selection to the nearest character at the same horizontal location on the line above.
Command–Equal : ... performs the same function.
 
Command–LeftArrow : Move the insertion point to the beginning of the current line.
 
Command–LeftCurlyBracket : Left align.
 
Command–RightArrow : Move the insertion point to the end of the current line.
 
Command–RightCurlyBracket : Right align.
 
Command–Shift–DownArrow : Select the text between the insertion point and the end of the document.
 
Command–Shift–LeftArrow : Select the text between the insertion point and the beginning of the current line.
 
Command–Shift–Minus : Decrease the size of the selected item.
 
Command–Shift–Plus : Increase the size of the selected item.
 
Command–Shift–QuestionMark : Open the Help menu.
 
Command–Shift–RightArrow : Select the text between the insertion point and the end of the current line.
 
Command–Shift–UpArrow : Select the text between the insertion point and the beginning of the document.
 
Command–Shift–VerticalBar : Center align.
 
Command–UpArrow : Move the insertion point to the beginning of the document.
 
Control-A : Move to the beginning of the line or paragraph.
 
Control-B : Move one character backward.
 
Control-D : Delete the character to the right of the insertion point. Or use Fn-Delete.
 
Control-E : Move to the end of a line or paragraph.
 
Control-F : Move one character forward.
 
Control-H : Delete the character to the left of the insertion point. Or use Delete.
 
Control-K : Delete the text between the insertion point and the end of the line or paragraph.
 
Control-L : Center the cursor or selection in the visible area.
 
Control-N : Move down one line.
 
Control-O : Insert a new line after the insertion point.
 
Control-P : Move up one line.
 
Control-T : Swap the character behind the insertion point with the character in front of the insertion point.
 
Fn-Delete : Forward delete on keyboards that don't have a Forward Delete   key. Or use Control-D.
 
Fn–DownArrow : Page Down: Scroll down one page.
 
Fn–LeftArrow : Home: Scroll to the beginning of a document.
 
Fn–RightArrow : End: Scroll to the end of a document.
 
Fn–UpArrow : Page Up: Scroll up one page.
 
Option-Delete : Delete the word to the left of the insertion point.
 
Option–LeftArrow : Move the insertion point to the beginning of the previous word.
 
Option–RightArrow : Move the insertion point to the end of the next word.
 
Shift–DownArrow : Extend text selection to the nearest character at the same horizontal location on the line below.
 
Shift–LeftArrow : Extend text selection one character to the left.
 
Shift–Option–DownArrow : Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again.
 
Shift–Option–LeftArrow : Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again.
 
Shift–Option–RightArrow : Extend text selection to the end of the current word, then to the end of the following word if pressed again.
 
Shift–Option–UpArrow : Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again.
 
Shift–RightArrow : Extend text selection one character to the right.
 
Shift–UpArrow : Extend text selection to the nearest character at the same horizontal location on the line above.
 
  
## Booting
+
<span id="booting"></span>
 +
== Booting ==
  
https://support.apple.com/en-eg/HT201255
+
https://support.apple.com/en-eg/HT201255 http://www.tech-recipes.com/rx/2818/os_x_ten_boot_options_for_leopard/
http://www.tech-recipes.com/rx/2818/os_x_ten_boot_options_for_leopard/
 
  
| Key                                               | Desc                                                         |
+
{|
| ------------------------------------------------- | ------------------------------------------------------------ |
+
!width="44%"| Key
| C                                                 | Boot from CD/DVD                                             |
+
!width="55%"| Desc
| D / Option-D                                     | Diagnostics or Apple Hardware Test mode / via-Internet. 1) Unplug MacBook Pro from power, and fully power off the machine. 2) Power on and press-and-hold the D key. 3) Release when prompted to choose a language. |
+
|-
| N                                                 | Netboot                                                     |
+
| C
| R                                                 | PowerBook Display Reset                                     |
+
| Boot from CD/DVD
| T                                                 | Target disk mode                                             |
+
|-
| X                                                 | Startup from OS X instead of from non-OS X startup           |
+
| D / Option-D
| ⌘-Option-P-R                                     | Reset PRAM. Do immediately after powering on, and release after 2nd Apple logo or 20sec, whichever comes first. |
+
| Diagnostics or Apple Hardware Test mode / via-Internet. 1) Unplug MacBook Pro from power, and fully power off the machine. 2) Power on and press-and-hold the D key. 3) Release when prompted to choose a language.
| ⌘-R / ⌘-Option-R                                 | OS X Recovery / over the Internet                           |
+
|-
| Command-S                                         | Single User Mode                                             |
+
| N
| Command-V                                         | Verbose Boot                                                 |
+
| Netboot
| LeftShift-Control-Option-Power                   | [Reset SMC](https://support.apple.com/en-us/HT201295). Do with power off. Hold for 10 sec, then power on again. |
+
|-
| Left_Mouse / F12 / mouse_button / trackpad_button | Eject Media                                                 |
+
| R
| Option                                           | Startup Manager                                             |
+
| PowerBook Display Reset
| Option-D                                         | Diagnostics or Apple Hardware Test via Internet             |
+
|-
| Option-N                                         | NetBoot using default image                                 |
+
| T
| Shift                                             | Safe Mode                                                   |
+
| Target disk mode
 +
|-
 +
| X
 +
| Startup from OS X instead of from non-OS X startup
 +
|-
 +
| ⌘-Option-P-R
 +
| Reset PRAM. Do immediately after powering on, and release after 2nd Apple logo or 20sec, whichever comes first.
 +
|-
 +
| ⌘-R / ⌘-Option-R
 +
| OS X Recovery / over the Internet
 +
|-
 +
| Command-S
 +
| Single User Mode
 +
|-
 +
| Command-V
 +
| Verbose Boot
 +
|-
 +
| LeftShift-Control-Option-Power
 +
| [https://support.apple.com/en-us/HT201295 Reset SMC]. Do with power off. Hold for 10 sec, then power on again.
 +
|-
 +
| Left_Mouse / F12 / mouse_button / trackpad_button
 +
| Eject Media
 +
|-
 +
| Option
 +
| Startup Manager
 +
|-
 +
| Option-D
 +
| Diagnostics or Apple Hardware Test via Internet
 +
|-
 +
| Option-N
 +
| NetBoot using default image
 +
|-
 +
| Shift
 +
| Safe Mode
 +
|}
  
# Downloads
+
<span id="downloads"></span>
 +
= Downloads =
  
[How to create a bootable installer for macOS](https://support.apple.com/en-us/HT201372)
+
[https://support.apple.com/en-us/HT201372 How to create a bootable installer for macOS]
  
10.15 [Catalina](https://itunes.apple.com/us/app/macos-catalina/id1466841314?ls=1&mt=12)
+
10.15 [https://itunes.apple.com/us/app/macos-catalina/id1466841314?ls=1&mt=12 Catalina]
  
```
+
<pre>sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia \
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia \
+
   --volume /Volumes/MyVolume</pre>
   --volume /Volumes/MyVolume
+
10.14 [https://itunes.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12 Mojave]
```
 
  
10.14 [Mojave](https://itunes.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12)
+
<pre>sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia \
 +
  --volume /Volumes/MyVolume</pre>
 +
10.13 [https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12 High Sierra]
  
```
+
<pre>sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia \
+
   --volume /Volumes/MyVolume</pre>
   --volume /Volumes/MyVolume
+
10.12 [http://updates-http.cdn-apple.com/2019/cert/061-41343-20191023-02465f92-3ab5-4c92-bfe2-b725447a070d/InstallMacOSX.dmg Yosemite]
```
 
  
10.13 [High Sierra](https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12)
+
10.11 [http://updates-http.cdn-apple.com/2019/cert/061-41424-20191024-218af9ec-cf50-4516-9011-228c78eda3d2/InstallMacOSX.dmg El Capitan]
  
```
+
<pre>sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
 
  --volume /Volumes/MyVolume
 
```
 
 
 
10.12 [Yosemite](http://updates-http.cdn-apple.com/2019/cert/061-41343-20191023-02465f92-3ab5-4c92-bfe2-b725447a070d/InstallMacOSX.dmg)
 
 
 
10.11 [El Capitan](http://updates-http.cdn-apple.com/2019/cert/061-41424-20191024-218af9ec-cf50-4516-9011-228c78eda3d2/InstallMacOSX.dmg)
 
 
 
```
 
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
 
 
   --volume /Volumes/MyVolume \
 
   --volume /Volumes/MyVolume \
   --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app
+
   --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app</pre>
```
+
10.10 [http://updates-http.cdn-apple.com/2019/cert/061-39476-20191023-48f365f4-0015-4c41-9f44-39d3d2aca067/InstallOS.dmg Sierra]
  
10.10 [Sierra](http://updates-http.cdn-apple.com/2019/cert/061-39476-20191023-48f365f4-0015-4c41-9f44-39d3d2aca067/InstallOS.dmg)
+
<pre>$ sudo /Applications/Install\ OS\ X\ Sierra.app/Contents/Resources/createinstallmedia \
 
 
```
 
$ sudo /Applications/Install\ OS\ X\ Sierra.app/Contents/Resources/createinstallmedia \
 
 
   --volume /Volumes/MyVolume \
 
   --volume /Volumes/MyVolume \
   --applicationpath /Applications/Install\ OS\ X\ Sierra.app
+
   --applicationpath /Applications/Install\ OS\ X\ Sierra.app</pre>
```
 
 
 
 
10.9 Maverics
 
10.9 Maverics
  
```
+
<pre>$ sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia \
$ sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia \
 
 
   --volume /Volumes/MyVolume \
 
   --volume /Volumes/MyVolume \
   --applicationpath /Applications/Install\ OS\ X\ Mavericks.app
+
   --applicationpath /Applications/Install\ OS\ X\ Mavericks.app</pre>
```
+
[https://support.apple.com/downloads/tiger Legacy]
 
 
[Legacy](https://support.apple.com/downloads/tiger)
 
  
 
See also: https://appleinsider.com/articles/19/11/23/how-to-get-an-old-macos-installer-from-apple
 
See also: https://appleinsider.com/articles/19/11/23/how-to-get-an-old-macos-installer-from-apple
  
# File systems
+
<span id="file-systems"></span>
 +
= File systems =
  
## Create ISO from CDR
+
<span id="create-iso-from-cdr"></span>
 +
== Create ISO from CDR ==
  
 
https://forums.macrumors.com/threads/converting-cdr-to-iso.783690/
 
https://forums.macrumors.com/threads/converting-cdr-to-iso.783690/
Line 255: Line 325:
 
Convert a CDR to ISO.
 
Convert a CDR to ISO.
  
```console
+
<syntaxhighlight lang="console">$ hdiutil makehybrid -iso -joliet -o diskimage.iso diskimage.cdr</syntaxhighlight>
$ hdiutil makehybrid -iso -joliet -o diskimage.iso diskimage.cdr
+
<span id="write-iso-to-usb"></span>
```
+
== Write ISO to USB ==
 
 
## Write ISO to USB
 
  
 
For bootable images, use one of:
 
For bootable images, use one of:
  
- [Etcher](https://www.balena.io/etcher/) -- **recommended** for bootable CD/DVD
+
* [https://www.balena.io/etcher/ Etcher] – '''recommended''' for bootable CD/DVD
- [UNetbootin](http://unetbootin.github.io/) -- useful if additional FreeDOS boot is needed (e.g. for firmware upgrades)
+
* [http://unetbootin.github.io/ UNetbootin] – useful if additional FreeDOS boot is needed (e.g. for firmware upgrades)
  
 
For data only…
 
For data only…
Line 270: Line 338:
 
https://snipt.net/w00kie/how-do-i-burn-an-iso-on-a-usb-drive-on-mac-os-x/
 
https://snipt.net/w00kie/how-do-i-burn-an-iso-on-a-usb-drive-on-mac-os-x/
  
Convert the file to a Disk Image. Note a `.dmg` extension will be added.
+
Convert the file to a Disk Image. Note a <code>.dmg</code> extension will be added.
 
 
```console
 
$ hdiutil convert -format UDRW -o /path/to/target /path/to/original.iso
 
```
 
  
 +
<syntaxhighlight lang="console">$ hdiutil convert -format UDRW -o /path/to/target /path/to/original.iso</syntaxhighlight>
 
Find current devices
 
Find current devices
  
```console
+
<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight>
$ diskutil list
 
```
 
 
 
 
Unmount device
 
Unmount device
  
```console
+
<syntaxhighlight lang="console">$ diskutil unmountDisk /dev/diskN</syntaxhighlight>
$ diskutil unmountDisk /dev/diskN
 
```
 
 
 
 
Write to USB
 
Write to USB
  
```console
+
<syntaxhighlight lang="console">$ sudo dd if=/path/to/target.dmg of=/dev/rdiskN bs=1m</syntaxhighlight>
$ sudo dd if=/path/to/target.dmg of=/dev/rdiskN bs=1m
 
```
 
 
 
 
Eject the disk
 
Eject the disk
  
```console
+
<syntaxhighlight lang="console">$ diskutil eject /dev/diskN</syntaxhighlight>
$ diskutil eject /dev/diskN
+
<span id="format-a-disk-from-the-command-line"></span>
```
+
== Format a disk from the command-line ==
 
 
## Format a disk from the command-line
 
  
 
Format with JHFS+ (Journaled HFS+) with a GPT partition layout.
 
Format with JHFS+ (Journaled HFS+) with a GPT partition layout.
  
    diskutil eraseDisk jhfs+ "ICY BOX 500G" gpt /dev/diskX
+
<pre>diskutil eraseDisk jhfs+ &quot;ICY BOX 500G&quot; gpt /dev/diskX</pre>
 
+
<span id="create-custom-corestorage-drive"></span>
## Create custom CoreStorage drive
+
== Create custom CoreStorage drive ==
  
 
http://www.cnet.com/how-to/how-to-make-a-custom-corestorage-drive-in-os-x/
 
http://www.cnet.com/how-to/how-to-make-a-custom-corestorage-drive-in-os-x/
Line 312: Line 366:
 
Create a CoreStorage volume. Will be using disk0 (SSD) and disk1 (HDD).
 
Create a CoreStorage volume. Will be using disk0 (SSD) and disk1 (HDD).
  
Partition all drives to be part of CS with single GUID partition, named 'Untitled'. Then determine their drive names
+
Partition all drives to be part of CS with single GUID partition, named ‘Untitled’. Then determine their drive names
 
 
```console
 
$ diskutil list
 
```
 
  
 +
<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight>
 
Create the logical volume group. Note the 1st drive is the SSD drive, and 2nd is drive is the HDD.
 
Create the logical volume group. Note the 1st drive is the SSD drive, and 2nd is drive is the HDD.
  
```console
+
<syntaxhighlight lang="console">$ diskutil cs create Macintosh\ LVG disk0 disk1</syntaxhighlight>
$ diskutil cs create Macintosh\ LVG disk0 disk1
 
```
 
 
 
 
List CS volumes
 
List CS volumes
  
```console
+
<syntaxhighlight lang="console">$ diskutil cs list</syntaxhighlight>
$ diskutil cs list
 
```
 
 
 
 
Create volume in the volume group using UUID of LVG
 
Create volume in the volume group using UUID of LVG
  
```console
+
<syntaxhighlight lang="console">$ diskutil cs createVolume UUID jhfs+ Macintosh\ HD 100%</syntaxhighlight>
$ diskutil cs createVolume UUID jhfs+ Macintosh\ HD 100%
 
```
 
 
 
 
If desired, encrypt the logical volume just created
 
If desired, encrypt the logical volume just created
  
```console
+
<syntaxhighlight lang="console">$ diskutil cs list
$ diskutil cs list
+
$ diskutil cs encryptVolume UUID</syntaxhighlight>
$ diskutil cs encryptVolume UUID
 
```
 
 
 
 
Delete a CS LVG.
 
Delete a CS LVG.
  
```console
+
<syntaxhighlight lang="console">$ diskutil cs delete UUID</syntaxhighlight>
$ diskutil cs delete UUID
+
<span id="get-serial-number-of-drive"></span>
```
+
== Get serial number of drive ==
  
## Get serial number of drive
+
<syntaxhighlight lang="console">$ ioreg -l |less</syntaxhighlight>
 
+
== ditto ==
```console
 
$ ioreg -l |less
 
```
 
 
 
## ditto
 
  
 
Mirror directories in OS X, preserving all ownership and permission data.
 
Mirror directories in OS X, preserving all ownership and permission data.
  
```console
+
<syntaxhighlight lang="console"># ditto -V /Users /Volumes/SecondaryHD/Users</syntaxhighlight>
# ditto -V /Users /Volumes/SecondaryHD/Users
+
<span id="write-dmg-to-disk"></span>
```
+
== Write DMG to disk ==
 
 
## Write DMG to disk
 
  
 
http://coolestguyplanettech.com/downtown/how-image-mac-os-x-107-lion-command-lineterminal
 
http://coolestguyplanettech.com/downtown/how-image-mac-os-x-107-lion-command-lineterminal
  
1. Mount the destination drive
+
# Mount the destination drive
2. Issue this command, replacing source and destination paths
+
# Issue this command, replacing source and destination paths
  
```console
+
<syntaxhighlight lang="console">$ asr restore \
$ asr restore \
 
 
--source /path-to-source-dmg-image \
 
--source /path-to-source-dmg-image \
 
--target /Volumes/path-to-destination-volume \
 
--target /Volumes/path-to-destination-volume \
 
--erase \
 
--erase \
 
--format HFS+ \
 
--format HFS+ \
--noverify
+
--noverify</syntaxhighlight>
```
+
* The '''–erase''' will erase the destination format
 
+
* The '''–format''' is optional and only required if the destination needs to be reformatted
- The **--erase** will erase the destination format
+
* The '''–noverify''' is optional and skips verification - but obviously doesn’t verify a successful restore.
- The **--format** is optional and only required if the destination needs to be reformatted
 
- The **--noverify** is optional and skips verification - but obviously doesn't verify a successful restore.
 
  
## Mount DMG as disk -- loopback
+
<span id="mount-dmg-as-disk-loopback"></span>
 +
== Mount DMG as disk loopback ==
  
 
http://apple.stackexchange.com/questions/9284/does-mac-have-something-similar-to-a-linux-loop-device
 
http://apple.stackexchange.com/questions/9284/does-mac-have-something-similar-to-a-linux-loop-device
  
The upgrade from MacOS 10.12.1 to 10.12.2 broke my APFS formatted Ableton SDCard drive. Ugh :-(. Luckily I still had a machine running 10.12.1, so I figured I'd try to fix things.
+
The upgrade from MacOS 10.12.1 to 10.12.2 broke my APFS formatted Ableton SDCard drive. Ugh :-(. Luckily I still had a machine running 10.12.1, so I figured I’d try to fix things.
 
 
I started by dumping the raw disk `/dev/disk2` using `dd`.
 
 
 
```console
 
$ dd if=/dev/disk2 of=/Volumes/Samsung_T1/Ableton-d2.dmg bs=1m
 
```
 
  
Mount the disk. _Note: I could have added the `-nomount` option after `attach` to have prevented the disk from actually mounting._
+
I started by dumping the raw disk <code>/dev/disk2</code> using <code>dd</code>.
  
```console
+
<syntaxhighlight lang="console">$ dd if=/dev/disk2 of=/Volumes/Samsung_T1/Ableton-d2.dmg bs=1m</syntaxhighlight>
$ hdiutil attach /Volumes/Samsung_T1/Ableton-d2.dmg
+
Mount the disk. ''Note: I could have added the <code>-nomount</code> option after <code>attach</code> to have prevented the disk from actually mounting.''
/dev/disk2          GUID_partition_scheme
 
/dev/disk2s1        EFI
 
/dev/disk2s2        Apple_APFS
 
/dev/disk2s2s1      41504653-0000-11AA-AA11-0030654
 
```
 
  
 +
<syntaxhighlight lang="console">$ hdiutil attach /Volumes/Samsung_T1/Ableton-d2.dmg
 +
/dev/disk2              GUID_partition_scheme
 +
/dev/disk2s1            EFI
 +
/dev/disk2s2            Apple_APFS
 +
/dev/disk2s2s1          41504653-0000-11AA-AA11-0030654</syntaxhighlight>
 
Yay!
 
Yay!
  
## APFS
+
<span id="apfs"></span>
 +
== APFS ==
  
- https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/APFS_Guide/Introduction/Introduction.html
+
* https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/APFS_Guide/Introduction/Introduction.html
- http://www.howtogeek.com/272741/how-to-format-a-drive-with-the-apfs-file-system-on-macos-sierra/
+
* http://www.howtogeek.com/272741/how-to-format-a-drive-with-the-apfs-file-system-on-macos-sierra/
  
**Sparse image**
+
'''Sparse image'''
  
 
Create a sparse image with APFS.
 
Create a sparse image with APFS.
  
```console
+
<syntaxhighlight lang="console">$ hdiutil create -fs APFS -size 1GB foo.sparseimage</syntaxhighlight>
$ hdiutil create -fs APFS -size 1GB foo.sparseimage
+
'''Physical disk'''
```
 
 
 
**Physical disk**
 
  
 
Partition the disk
 
Partition the disk
  
```console
+
<syntaxhighlight lang="console">$ sudo diskutil partitionDisk disk2 APFS Untitled 100%</syntaxhighlight>
$ sudo diskutil partitionDisk disk2 APFS Untitled 100%
+
'''Existing partition'''
```
 
 
 
**Existing partition**
 
  
 
Create APFS container.
 
Create APFS container.
  
```console
+
<syntaxhighlight lang="console">$ diskutil apfs createContainer /dev/disk2s2</syntaxhighlight>
$ diskutil apfs createContainer /dev/disk2s2
 
```
 
 
 
 
Create APFS volume in an APFS container.
 
Create APFS volume in an APFS container.
  
```console
+
<syntaxhighlight lang="console">$ diskutil apfs addVolume disk2s2 APFS newAPFS</syntaxhighlight>
$ diskutil apfs addVolume disk2s2 APFS newAPFS
 
```
 
 
 
 
FSCK.
 
FSCK.
  
```console
+
<syntaxhighlight lang="console">$ fsck_apfs /dev/disk2s2</syntaxhighlight>
$ fsck_apfs /dev/disk2s2
+
<span id="nfs"></span>
```
+
== NFS ==
 
 
## NFS
 
  
 
Change default behavior to work better with Linux servers.
 
Change default behavior to work better with Linux servers.
  
- https://j-li.net/posts/mounting-a-linux-nfs-on-osx
+
* https://j-li.net/posts/mounting-a-linux-nfs-on-osx
  
`/etc/nfs.conf`
+
<code>/etc/nfs.conf</code>
  
```
+
<pre># Generated automatically by NFS Manager 2016-10-19 23:06:36 +0000
# Generated automatically by NFS Manager 2016-10-19 23:06:36 +0000
 
 
nfs.client.allow_async = 1
 
nfs.client.allow_async = 1
 
nfs.client.nfsiod_thread_max = 128
 
nfs.client.nfsiod_thread_max = 128
 
nfs.client.mount.options = nfc,intr
 
nfs.client.mount.options = nfc,intr
nfs.client.is_mobile = 0
+
nfs.client.is_mobile = 0</pre>
```
+
<span id="restart-autofs-without-rebooting."></span>
 
+
== Restart autofs without rebooting. ==
## Restart autofs without rebooting.
 
 
 
Use the `automount` command.
 
  
```console
+
Use the <code>automount</code> command.
$ sudo automount -vc
 
```
 
  
Alternatively, use `launchctl`.
+
<syntaxhighlight lang="console">$ sudo automount -vc</syntaxhighlight>
 +
Alternatively, use <code>launchctl</code>.
  
```console
+
<syntaxhighlight lang="console">$ sudo launchctl stop com.apple.autofsd</syntaxhighlight>
$ sudo launchctl stop com.apple.autofsd
+
<span id="partitioning"></span>
```
+
== Partitioning ==
 
 
## Partitioning
 
  
 
References
 
References
  
- <https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html#//apple_ref/doc/uid/TP40016999-CH7-DontLinkElementID_13>
+
* https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html#//apple_ref/doc/uid/TP40016999-CH7-DontLinkElementID_13
- <http://www.theinstructional.com/guides/disk-management-from-the-command-line-part-2>
+
* http://www.theinstructional.com/guides/disk-management-from-the-command-line-part-2
  
 
Get list of info
 
Get list of info
  
```console
+
<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight>
$ diskutil list
 
```
 
 
 
 
Format an entire drive as APFS
 
Format an entire drive as APFS
  
```console
+
<syntaxhighlight lang="console"># command verb disk boot_record filesystem name size
# command verb disk boot_record filesystem name size
+
$ diskutil partitionDisk /dev/diskX GPT APFS NewName 0b</syntaxhighlight>
$ diskutil partitionDisk /dev/diskX GPT APFS NewName 0b
 
```
 
 
 
 
Arguments:
 
Arguments:
  
- Boot Records
+
* Boot Records
  - GPT (GUID Partition Table)
+
** GPT (GUID Partition Table)
  - MBR (Master Boot Record)
+
** MBR (Master Boot Record)
- Filesystems
+
* Filesystems
  - APFS (Apple File System -- beta in Sierra 10.12.1)
+
** APFS (Apple File System beta in Sierra 10.12.1)
  - ExFAT
+
** ExFAT
  - FAT32
+
** FAT32
  - HFS+ (Apple HFS+)
+
** HFS+ (Apple HFS+)
  
## Locked files or folders
+
<span id="locked-files-or-folders"></span>
 +
== Locked files or folders ==
  
 
Look at the current flags:
 
Look at the current flags:
  
```console
+
<syntaxhighlight lang="console">$ ls -lO /path/to/folder</syntaxhighlight>
$ ls -lO /path/to/folder
 
```
 
 
 
 
Unlock them with:
 
Unlock them with:
  
```console
+
<syntaxhighlight lang="console">$ chflags nouchg /path/to/locked/folder</syntaxhighlight>
$ chflags nouchg /path/to/locked/folder
 
```
 
 
 
 
or with:
 
or with:
  
```console
+
<syntaxhighlight lang="console">$ SetFile -a l /path/to/locked/folder</syntaxhighlight>
$ SetFile -a l /path/to/locked/folder
+
<span id="cookbook"></span>
```
+
= Cookbook =
 
 
# Cookbook
 
 
 
## Homebrew
 
  
The `ftp` and `telnet` are no longer included with macOS, but can be installed with Brew.
+
<span id="homebrew"></span>
 +
== Homebrew ==
  
    $ brew install inetutils
+
The <code>ftp</code> and <code>telnet</code> are no longer included with macOS, but can be installed with Brew.
  
## Resize a sparse bundle
+
<pre>$ brew install inetutils</pre>
 +
<span id="resize-a-sparse-bundle"></span>
 +
== Resize a sparse bundle ==
  
 
Unmount the image, and follow commands below.
 
Unmount the image, and follow commands below.
Line 543: Line 535:
 
Compact the image (size stays the same).
 
Compact the image (size stays the same).
  
    hdiutil compact filename.sparsebundle
+
<pre>hdiutil compact filename.sparsebundle</pre>
 +
Increase the size of the image (e.g. 8G to 12G).
  
Increase the size of the image (e.g. 8G to 12G).
+
<pre>hdiutil resize -size 12G filename.sparsebundle</pre>
 +
<span id="paragraph-sorting-service"></span>
 +
== Paragraph Sorting Service ==
  
    hdiutil resize -size 12G filename.sparsebundle
+
http://www.macosxautomation.com/services/learn/tut03/index.html
  
## Paragraph Sorting Service
+
<ol style="list-style-type: decimal;">
 +
<li>Open Automator.</li>
 +
<li>Create a new “Service” workflow.</li>
 +
<li>Configure workflow.
 +
<ol style="list-style-type: lower-alpha;">
 +
<li>Service receives selected &gt; text</li>
 +
<li>in &gt; any application</li>
 +
<li>check &lt; Replaces selected text</li></ol>
  
http://www.macosxautomation.com/services/learn/tut03/index.html
+
<ol start="4" style="list-style-type: decimal;">
 +
<li></li></ol>
 +
</li></ol>
  
1. Open Automator.
+
<span id="disable-the-swoosh-animation-for-mac-os-x-spaces"></span>
2. Create a new "Service" workflow.
+
== Disable the Swoosh animation for Mac OS X Spaces ==
3. Configure workflow.
 
  a. Service receives selected > text
 
  b. in > any application
 
  c. check < Replaces selected text
 
  4.
 
 
 
## Disable the Swoosh animation for Mac OS X Spaces
 
  
 
macOS [10.12)
 
macOS [10.12)
  
System Preferences > Accessibility > Display > Reduce motion
+
System Preferences &gt; Accessibility &gt; Display &gt; Reduce motion
  
 
macOS (10.11]
 
macOS (10.11]
  
- http://blog.sysmgr.org/2011/02/disable-swoosh-animation-for-mac-os-x.html
+
* http://blog.sysmgr.org/2011/02/disable-swoosh-animation-for-mac-os-x.html
- http://secrets.blacktree.com/?showapp=com.apple.dock -- interesting
+
* http://secrets.blacktree.com/?showapp=com.apple.dock interesting
- http://www.macosxhints.com/comment.php?mode=view&cid=117778
+
* http://www.macosxhints.com/comment.php?mode=view&amp;cid=117778
  
```console
+
<syntaxhighlight lang="console">$ defaults write com.apple.dock \
$ defaults write com.apple.dock \
 
 
   workspaces-swoosh-animation-off \
 
   workspaces-swoosh-animation-off \
 
   -bool YES &&
 
   -bool YES &&
   killall Dock
+
   killall Dock</syntaxhighlight>
```
+
<span id="change-screen-capture-behavior."></span>
 
+
== Change screen capture behavior. ==
## Change screen capture behavior.
 
  
 
Disable shadow on screen capture.
 
Disable shadow on screen capture.
  
```
+
<pre>$ defaults write com.apple.screencapture disable-shadow -bool TRUE
$ defaults write com.apple.screencapture disable-shadow -bool TRUE
+
$ killall SystemUIServer</pre>
$ killall SystemUIServer
 
```
 
 
 
 
Change the location of screen captures.
 
Change the location of screen captures.
  
```
+
<pre>$ defaults write com.apple.screencapture location ~/Pictures/Screenshots</pre>
$ defaults write com.apple.screencapture location ~/Pictures/Screenshots
 
```
 
 
 
 
Change the prefix of the screen capture filename.
 
Change the prefix of the screen capture filename.
  
```
+
<pre>$ defaults write com.apple.screencapture name &quot;Pretty Picture&quot;
$ defaults write com.apple.screencapture name "Pretty Picture"
+
$ killall SystemUIServer</pre>
$ killall SystemUIServer
 
```
 
 
 
 
Take a screen capture as PDF (PNG is default).
 
Take a screen capture as PDF (PNG is default).
  
```
+
<pre>$ defaults write com.apple.screencapture type pdf</pre>
$ defaults write com.apple.screencapture type pdf
+
<span id="endisable-bonjour-announcements-10.5"></span>
```
+
== (En|Dis)able Bonjour Announcements (10.5+) ==
 
 
 
 
## (En|Dis)able Bonjour Announcements (10.5+)
 
  
 
Disable
 
Disable
  
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
+
<pre>$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist</pre>
 
 
 
Enable
 
Enable
  
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
+
<pre>$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist</pre>
 
 
 
To leave it enabled, but not announce things via multicast DNS, edit the plist and add this line to the mDNSResponder options.
 
To leave it enabled, but not announce things via multicast DNS, edit the plist and add this line to the mDNSResponder options.
  
<string>-NoMulticastAdvertisements</string>
+
<pre>&lt;string&gt;-NoMulticastAdvertisements&lt;/string&gt;</pre>
 
+
<span id="time-machine"></span>
## Time Machine
+
== Time Machine ==
  
Change backup frequency (10.5+)
+
Change backup frequency (10.5+) http://hints.macworld.com/article.php?story=200710291721156
http://hints.macworld.com/article.php?story=200710291721156
 
  
 
Edit /System/Library/LaunchDaemons/com.apple.backupd-auto.plist and update the StartInterval setting. 3600[s] is 1h.
 
Edit /System/Library/LaunchDaemons/com.apple.backupd-auto.plist and update the StartInterval setting. 3600[s] is 1h.
  
## Cron'd stuff
+
<span id="crond-stuff"></span>
 +
== Cron’d stuff ==
  
See entry at Oct 19, '10 08:03:30PM in http://hints.macworld.com/article.php?story=200710291721156
+
See entry at Oct 19, ’10 08:03:30PM in http://hints.macworld.com/article.php?story=200710291721156
  
## Sleep
+
<span id="sleep"></span>
 +
== Sleep ==
  
 
Sleep machine from command-line (10.5+)
 
Sleep machine from command-line (10.5+)
  
    $ pmset sleepnow
+
<pre>$ pmset sleepnow</pre>
 
+
=== pmset ===
### pmset
 
 
 
See 'man pmset' for more info. For 10.4 and prior, see
 
http://www.snoize.com/SleepNow/.
 
  
Figure out why machine isn't sleeping.
+
See ‘man pmset’ for more info. For 10.4 and prior, see http://www.snoize.com/SleepNow/.
  
    $ pmset -g assertions
+
Figure out why machine isn’t sleeping.
  
 +
<pre>$ pmset -g assertions</pre>
 
Log sleep/wake messages
 
Log sleep/wake messages
  
    $ pmset -g pslog
+
<pre>$ pmset -g pslog</pre>
 
 
 
View the logs later
 
View the logs later
  
    $ pmset -g
+
<pre>$ pmset -g</pre>
 
+
<span id="endisable-swap"></span>
## (En|Dis)able swap
+
== (En|Dis)able swap ==
  
 
http://hints.macworld.com/article.php?story=201106020948369
 
http://hints.macworld.com/article.php?story=201106020948369
Line 663: Line 641:
 
Disable
 
Disable
  
```console
+
<syntaxhighlight lang="console">$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
+
$ sudo rm /private/var/vm/swapfile*</syntaxhighlight>
$ sudo rm /private/var/vm/swapfile*
 
```
 
 
 
 
Enable
 
Enable
  
```console
+
<syntaxhighlight lang="console">$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist</syntaxhighlight>
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
+
<span id="smart"></span>
```
+
== SMART ==
 
 
## SMART
 
  
 
http://hints.macworld.com/article.php?story=20031122041138373
 
http://hints.macworld.com/article.php?story=20031122041138373
Line 680: Line 653:
 
Get SMART status from the command-line
 
Get SMART status from the command-line
  
```console
+
<syntaxhighlight lang="console"># diskutil list
# diskutil list
+
# diskutil info diskX |grep SMART</syntaxhighlight>
# diskutil info diskX |grep SMART
+
== sysctl ==
```
 
 
 
## sysctl
 
  
[Performance Tuning the Network Stack  Mac OS X](http://rolande.wordpress.com/2010/12/30/performance-tuning-the-network-stack-on-mac-osx-10-6/)
+
[http://rolande.wordpress.com/2010/12/30/performance-tuning-the-network-stack-on-mac-osx-10-6/ Performance Tuning the Network Stack Mac OS X]
  
 
Versions: [10.5-10.8)
 
Versions: [10.5-10.8)
  
Put data into `/etc/sysctl.conf`.
+
Put data into <code>/etc/sysctl.conf</code>.
  
```
+
<pre>kern.ipc.maxsockbuf=4194304
kern.ipc.maxsockbuf=4194304
 
 
kern.ipc.somaxconn=512
 
kern.ipc.somaxconn=512
 
kern.ipc.nmbclusters=2048
 
kern.ipc.nmbclusters=2048
Line 709: Line 678:
 
net.inet.tcp.blackhole=2
 
net.inet.tcp.blackhole=2
 
net.inet.udp.blackhole=1
 
net.inet.udp.blackhole=1
net.inet.icmp.icmplim=50
+
net.inet.icmp.icmplim=50</pre>
```
 
 
 
 
Change these values for [10.8)
 
Change these values for [10.8)
  
```
+
<pre>kern.ipc.maxsockbuf=8388608
kern.ipc.maxsockbuf=8388608
 
  
 
# Enable support for 9000+ byte packets.
 
# Enable support for 9000+ byte packets.
 
# https://blah.cloud/hardware/test-jumbo-frames-working/
 
# https://blah.cloud/hardware/test-jumbo-frames-working/
net.inet.raw.maxdgram=16384
+
net.inet.raw.maxdgram=16384</pre>
```
+
(old) Recommended values for <code>/etc/sysctl.conf</code>.
 
 
(old) Recommended values for `/etc/sysctl.conf`.
 
  
| key                           | default | recommended | notes                     |
+
{|
| ----------------------------- | ------- | ----------- | -------------------------- |
+
! key
| net.inet.tcp.mssdflt         | 512     | 1440       |                           |
+
! default
| net.inet.tcp.win_scale_factor | 3       | 10         |                           |
+
! recommended
| net.inet.tcp.sendspace       | 65536   | 2097152     | 1/2 of kern.ipc.maxsockbuf |
+
! notes
| net.inet.tcp.recvspace       | 65536   | 2097152     | 1/2 of kern.ipc.maxsockbuf |
+
|-
 +
| net.inet.tcp.mssdflt
 +
| 512
 +
| 1440
 +
|
 +
|-
 +
| net.inet.tcp.win_scale_factor
 +
| 3
 +
| 10
 +
|
 +
|-
 +
| net.inet.tcp.sendspace
 +
| 65536
 +
| 2097152
 +
| 1/2 of kern.ipc.maxsockbuf
 +
|-
 +
| net.inet.tcp.recvspace
 +
| 65536
 +
| 2097152
 +
| 1/2 of kern.ipc.maxsockbuf
 +
|}
  
## Spotlight
+
<span id="spotlight"></span>
 +
== Spotlight ==
  
 
Check status of Spotlight
 
Check status of Spotlight
  
```console
+
<syntaxhighlight lang="console"># mdutil -s /</syntaxhighlight>
# mdutil -s /
 
```
 
 
 
 
Enable Spotlight
 
Enable Spotlight
  
```console
+
<syntaxhighlight lang="console"># mdutil -i on /</syntaxhighlight>
# mdutil -i on /
 
```
 
 
 
 
Rebuilt database
 
Rebuilt database
  
```console
+
<syntaxhighlight lang="console"># mdutil -E /</syntaxhighlight>
# mdutil -E /
+
<span id="restart-finder-from-the-terminal"></span>
```
+
== Restart Finder from the Terminal ==
 
 
## Restart Finder from the Terminal
 
  
 
http://thewayeye.net/2012/january/4/how-restart-finder-terminal
 
http://thewayeye.net/2012/january/4/how-restart-finder-terminal
Line 757: Line 734:
 
Kill Finder
 
Kill Finder
  
```console
+
<syntaxhighlight lang="console">$ sudo killall Finder</syntaxhighlight>
$ sudo killall Finder
+
Manually start if it doesn’t automatically
```
 
 
 
Manually start if it doesn't automatically
 
 
 
```console
 
$ open /System/Library/CoreServices/Finder.app
 
```
 
  
 +
<syntaxhighlight lang="console">$ open /System/Library/CoreServices/Finder.app</syntaxhighlight>
 
If all else fails, reboot
 
If all else fails, reboot
  
```console
+
<syntaxhighlight lang="console">$ shutdown -r</syntaxhighlight>
$ shutdown -r
+
<span id="extract-contents-of-a-payload-file"></span>
```
+
== Extract contents of a Payload file ==
 
 
## Extract contents of a Payload file
 
  
 
These are basically compressed cpio files.
 
These are basically compressed cpio files.
  
```console
+
<syntaxhighlight lang="console">$ cat Payload |gzip -d |cpio -id</syntaxhighlight>
$ cat Payload |gzip -d |cpio -id
+
<span id="firewall"></span>
```
+
== Firewall ==
 
 
## Firewall
 
  
 
List apps allowed/blocked by firewall.
 
List apps allowed/blocked by firewall.
  
```console
+
<syntaxhighlight lang="console">$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listapps</syntaxhighlight>
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listapps
+
<span id="dtrace-and-other-scripts"></span>
```
+
== dtrace and other scripts ==
 
 
## dtrace and other scripts
 
  
 
http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/
 
http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/
  
## Power management
+
<span id="power-management"></span>
 +
== Power management ==
  
 
Get history of power management events
 
Get history of power management events
  
```console
+
<syntaxhighlight lang="console">$ pmset -g log |less</syntaxhighlight>
$ pmset -g log |less
+
<span id="icon-sets"></span>
```
+
== Icon sets ==
 
 
## Icon sets
 
  
 
http://blog.macsales.com/28492-create-your-own-custom-icons-in-10-7-5-or-later
 
http://blog.macsales.com/28492-create-your-own-custom-icons-in-10-7-5-or-later
Line 807: Line 771:
 
Create PNG files.
 
Create PNG files.
  
| Filename           | Image Size (in pixels) |
+
{|
| ------------------- | ---------------------- |
+
! Filename
| icon_512x512@2x.png | 1024 x 1024           |
+
! Image Size (in pixels)
| icon_512x512.png   | 512 x 512             |
+
|-
| icon_256x256@2x.png | 512 x 512             |
+
| icon_512x512@2x.png
| icon_256x256.png   | 256 x 256             |
+
| 1024 x 1024
| icon_128x128@2x.png | 256 x 256             |
+
|-
| icon_128x128.png   | 128 x 128             |
+
| icon_512x512.png
| icon_32x32@2x.png   | 64 x 64               |
+
| 512 x 512
| icon_32x32.png     | 32 x 32               |
+
|-
| icon_16x16@2x.png   | 32 x 32               |
+
| icon_256x256@2x.png
| icon_16x16.png     | 16 x 16               |
+
| 512 x 512
 +
|-
 +
| icon_256x256.png
 +
| 256 x 256
 +
|-
 +
| icon_128x128@2x.png
 +
| 256 x 256
 +
|-
 +
| icon_128x128.png
 +
| 128 x 128
 +
|-
 +
| icon_32x32@2x.png
 +
| 64 x 64
 +
|-
 +
| icon_32x32.png
 +
| 32 x 32
 +
|-
 +
| icon_16x16@2x.png
 +
| 32 x 32
 +
|-
 +
| icon_16x16.png
 +
| 16 x 16
 +
|}
  
Create an `myicon.iconset` folder, and put all files in that folder.
+
Create an <code>myicon.iconset</code> folder, and put all files in that folder.
  
Create a `myicon.icns` file.
+
Create a <code>myicon.icns</code> file.
  
```console
+
<syntaxhighlight lang="console">$ iconutil -c icns /path/to/myicon.iconset</syntaxhighlight>
$ iconutil -c icns /path/to/myicon.iconset
+
Get info about the drive / file, and copy the <code>myicon.icns</code> file over the drive icon of the file.
```
 
  
Get info about the drive / file, and copy the `myicon.icns` file over the drive
+
<span id="kill-parentalcontrolsd-regularly"></span>
icon of the file.
+
== Kill parentalcontrolsd regularly ==
  
## Kill parentalcontrolsd regularly
+
Create the following plist as <code>/Library/LaunchDaemons/com.forestent.noparentalcontrolsd</code> with root as owner.
  
Create the following plist as `/Library/LaunchDaemons/com.forestent.noparentalcontrolsd` with root as owner.
+
<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?>
 
 
```xml
 
<?xml version="1.0" encoding="UTF-8"?>
 
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<plist version="1.0">
 
<plist version="1.0">
Line 861: Line 843:
  
 
</dict>
 
</dict>
</plist>
+
</plist></syntaxhighlight>
```
 
 
 
 
Load the plist.
 
Load the plist.
  
```console
+
<syntaxhighlight lang="console">$ sudo launchctl load /Library/LaunchDaemons/com.forestent.noparentalcontrolsd</syntaxhighlight>
$ sudo launchctl load /Library/LaunchDaemons/com.forestent.noparentalcontrolsd
+
<span id="install-a-package-from-the-command-line"></span>
```
+
== Install a package from the command-line ==
 
 
## Install a package from the command-line
 
 
 
Use `/usr/sbin/installer`.
 
  
```console
+
Use <code>/usr/sbin/installer</code>.
$ sudo installer -pkg /path/to/package.pkg -target /
 
```
 
  
    sudo installer -pkg macOSUpd10.14.3.pkg -target / -verboseR -dumplog 2>&1 |tee ~/var/log/macOSUpd10.14.3.log
+
<syntaxhighlight lang="console">$ sudo installer -pkg /path/to/package.pkg -target /</syntaxhighlight>
 +
<pre>sudo installer -pkg macOSUpd10.14.3.pkg -target / -verboseR -dumplog 2&gt;&amp;1 |tee ~/var/log/macOSUpd10.14.3.log</pre>
 +
<span id="upgrade-software-from-the-command-line"></span>
 +
== Upgrade software from the command-line ==
  
## Upgrade software from the command-line
+
Use <code>softwareupdate</code>.
  
Use `softwareupdate`.
+
<syntaxhighlight lang="console">$ softwareupdate -l
 
 
```console
 
$ softwareupdate -l
 
 
Software Update Tool
 
Software Update Tool
  
Fining available software
+
Fining available software</syntaxhighlight>
```
+
If the updater is hitting problems, e.g. unable to contact update servers, consider resetting the catalogs. (Was needed for 10.14.3 at Google.)
 
 
If the updater is hitting problems, e.g. unable to contact update servers, consider resetting
 
the catalogs. (Was needed for 10.14.3 at Google.)
 
 
 
```shell
 
sudo softwareupdate --clear-catalog
 
```
 
 
 
## Change visibility of hidden folders
 
  
Use `/usr/bin/chflags`.
+
<syntaxhighlight lang="shell">sudo softwareupdate --clear-catalog</syntaxhighlight>
 +
<span id="change-visibility-of-hidden-folders"></span>
 +
== Change visibility of hidden folders ==
  
```
+
Use <code>/usr/bin/chflags</code>.
$ chflags nohidden ~/Library
 
```
 
  
## Force RGB Mode (a.k.a. fix horrible fonts)
+
<pre>$ chflags nohidden ~/Library</pre>
 +
<span id="force-rgb-mode-a.k.a.-fix-horrible-fonts"></span>
 +
== Force RGB Mode (a.k.a. fix horrible fonts) ==
  
 
http://www.iphonetopics.com/force-rgb-mode-in-mac-os-x/
 
http://www.iphonetopics.com/force-rgb-mode-in-mac-os-x/
  
# Misc. Utilities
+
<span id="misc.-utilities"></span>
 +
= Misc. Utilities =
  
## Expansion Slot Utility
+
<span id="expansion-slot-utility"></span>
 +
== Expansion Slot Utility ==
  
 
The utility is located in /System/Library/CoreServices and is used to configure the performance of the PCI slots.
 
The utility is located in /System/Library/CoreServices and is used to configure the performance of the PCI slots.
  
## Fonts
+
<span id="fonts"></span>
 +
== Fonts ==
  
https://discussions.apple.com/thread/3646002?tstart=0
+
https://discussions.apple.com/thread/3646002?tstart=0 http://www.thexlab.com/faqs/undofontbook.html http://www.jklstudios.com/misc/osxfonts.htm
http://www.thexlab.com/faqs/undofontbook.html
 
http://www.jklstudios.com/misc/osxfonts.htm
 
  
## pmset
+
<span id="pmset-1"></span>
 +
== pmset ==
  
 
Get the current settings
 
Get the current settings
  
```console
+
<syntaxhighlight lang="console">$ pmset -g
$ pmset -g
 
 
System-wide power settings:
 
System-wide power settings:
 
Currently in use:
 
Currently in use:
Line 945: Line 913:
 
  ttyskeepawake        1
 
  ttyskeepawake        1
 
  displaysleep        60
 
  displaysleep        60
  standbydelay        10800
+
  standbydelay        10800</syntaxhighlight>
```
+
=== autopoweroff ===
 
 
### autopoweroff
 
  
_This is the reason my 2013 Mac Pro wakes so slowly from sleep each morning._
+
''This is the reason my 2013 Mac Pro wakes so slowly from sleep each morning.''
  
 
https://support.apple.com/en-us/HT201635
 
https://support.apple.com/en-us/HT201635
  
**autopoweroff** is enabled by default on supported platforms as an implementation of Lot 6 to the European Energy-related Products Directive. After sleeping for `autopoweroffdelay` seconds, the system will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will take longer than wakeups from regular sleep.
+
'''autopoweroff''' is enabled by default on supported platforms as an implementation of Lot 6 to the European Energy-related Products Directive. After sleeping for <code>autopoweroffdelay</code> seconds, the system will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will take longer than wakeups from regular sleep.
  
## bputil
+
== bputil ==
  
 
https://keith.github.io/xcode-man-pages/bputil.1.html
 
https://keith.github.io/xcode-man-pages/bputil.1.html
Line 962: Line 928:
 
Utility to precisely modify the security settings on Apple Silicon Macs
 
Utility to precisely modify the security settings on Apple Silicon Macs
  
## trustd
+
== trustd ==
  
 
https://sneak.berlin/20201112/your-computer-isnt-yours/
 
https://sneak.berlin/20201112/your-computer-isnt-yours/
Line 968: Line 934:
 
This makes requests to ocsp.apple.com each and every time an app is opened. Ugh.
 
This makes requests to ocsp.apple.com each and every time an app is opened. Ugh.
  
# Troubleshooting
+
<span id="troubleshooting"></span>
 +
= Troubleshooting =
  
 
https://github.com/upekkha/AppleHardwareTest
 
https://github.com/upekkha/AppleHardwareTest
  
## Previous shutdown cause
+
<span id="previous-shutdown-cause"></span>
 +
== Previous shutdown cause ==
  
Look at the log on the command-line, and compare to documented causes can be
+
Look at the log on the command-line, and compare to documented causes can be found on this [https://georgegarside.com/blog/macos/shutdown-causes/ blog].
found on this [blog](https://georgegarside.com/blog/macos/shutdown-causes/).
 
  
```console
+
<syntaxhighlight lang="console">$ log show --predicate 'eventMessage contains "Previous shutdown cause:"'
$ log show --predicate 'eventMessage contains "Previous shutdown cause:"'
 
 
Skipping info and debug messages, pass --info and/or --debug to include.
 
Skipping info and debug messages, pass --info and/or --debug to include.
 
Filtering the log data using "eventMessage CONTAINS "Previous shutdown cause:""
 
Filtering the log data using "eventMessage CONTAINS "Previous shutdown cause:""
Line 986: Line 952:
 
  --------------------------------------------------------------------------------------------------------------------
 
  --------------------------------------------------------------------------------------------------------------------
 
Log      - Default:          2, Info:                0, Debug:            0, Error:          0, Fault:          0
 
Log      - Default:          2, Info:                0, Debug:            0, Error:          0, Fault:          0
Activity - Create:          0, Transition:          0, Actions:          0
+
Activity - Create:          0, Transition:          0, Actions:          0</syntaxhighlight>
```
+
<span id="mouse-lag"></span>
 
+
== Mouse Lag ==
## Mouse Lag
 
  
 
Try turning off the mouse, removing it from the Bluetooth preferences window, and repairing the device.
 
Try turning off the mouse, removing it from the Bluetooth preferences window, and repairing the device.
Line 995: Line 960:
 
On the Mac Pro (Late 2013) model, Wi-Fi seems to interfere with the Bluetooth signal such that the mouse lags. Disable Wi-Fi if possible, or use a hardwired mouse.
 
On the Mac Pro (Late 2013) model, Wi-Fi seems to interfere with the Bluetooth signal such that the mouse lags. Disable Wi-Fi if possible, or use a hardwired mouse.
  
## DNS resolution
+
<span id="dns-resolution"></span>
 +
== DNS resolution ==
  
- https://discussions.apple.com/thread/3339686?start=0&tstart=0
+
* https://discussions.apple.com/thread/3339686?start=0&amp;tstart=0
- http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/
+
* http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/
  
 
Get dump of resolvers
 
Get dump of resolvers
  
```console
+
<syntaxhighlight lang="console">$ scutil --dns</syntaxhighlight>
$ scutil --dns
+
<span id="reset-dns-cache"></span>
```
+
== Reset DNS cache ==
 
 
## Reset DNS cache
 
  
OS X <= 10.9.* && >= 10.10.4
+
OS X &lt;= 10.9.* &amp;&amp; &gt;= 10.10.4
 
 
```console
 
$ sudo killall -HUP mDNSResponder
 
```
 
  
 +
<syntaxhighlight lang="console">$ sudo killall -HUP mDNSResponder</syntaxhighlight>
 
OS X 10.10.0 - 10.10.3
 
OS X 10.10.0 - 10.10.3
  
```console
+
<syntaxhighlight lang="console">$ sudo discoveryutil mdnsflushcache</syntaxhighlight>
$ sudo discoveryutil mdnsflushcache
+
<span id="finder-file-is-damaged"></span>
```
+
== Finder – “File is damaged” ==
  
## Finder -- "File is damaged"
+
Finder is reporting “File is damaged” and “Move to Trash” or “Unmount disk”. If you know the file is fine, remove the quarantine <code>xattr</code>, and try again.
  
Finder is reporting "File is damaged" and "Move to Trash" or "Unmount disk". If you know the file is fine, remove the quarantine `xattr`, and try again.
+
<syntaxhighlight lang="console">$ xattr -d com.apple.quarantine /path/to/file</syntaxhighlight>
 
+
<span id="cannot-verify-installer"></span>
```console
+
== Cannot verify installer ==
$ xattr -d com.apple.quarantine /path/to/file
 
```
 
 
 
## Cannot verify installer
 
  
 
http://www.macrumors.com/2016/03/03/older-os-x-installers-broken-by-certificate/
 
http://www.macrumors.com/2016/03/03/older-os-x-installers-broken-by-certificate/
Line 1,034: Line 991:
 
Installers downloaded before Feb 14 2016 will not validate because the certificate used to sign the installer expired. To work around the issue, quit out of the installer, set the date back, and rerun the installer.
 
Installers downloaded before Feb 14 2016 will not validate because the certificate used to sign the installer expired. To work around the issue, quit out of the installer, set the date back, and rerun the installer.
  
```console
+
<syntaxhighlight lang="console">$ date 0201010116</syntaxhighlight>
$ date 0201010116
+
Alternatively, a newer version of the installer can be downloaded. Unfortunately, older OS X installs won’t be available, so the date method must be used.
```
 
 
 
Alternatively, a newer version of the installer can be downloaded. Unfortunately, older OS X installs won't be available, so the date method must be used.
 
  
## Look at available Wi-Fi networks
+
<span id="look-at-available-wi-fi-networks"></span>
 +
== Look at available Wi-Fi networks ==
  
 
http://apple.stackexchange.com/questions/131852/how-do-you-force-a-5-ghz-wifi-connection
 
http://apple.stackexchange.com/questions/131852/how-do-you-force-a-5-ghz-wifi-connection
Line 1,046: Line 1,001:
 
Scan for network BSSIDs.
 
Scan for network BSSIDs.
  
```console
+
<syntaxhighlight lang="console">/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport scan
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport scan
 
 
                             SSID BSSID            RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
 
                             SSID BSSID            RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
 
                         Valerie c0:25:06:cf:0c:d3 -78  100,+1  Y  DE WPA2(PSK/AES/AES)
 
                         Valerie c0:25:06:cf:0c:d3 -78  100,+1  Y  DE WPA2(PSK/AES/AES)
                         Valerie c0:25:06:cf:0c:d7 -69  11      Y  DE WPA2(PSK/AES/AES)
+
                         Valerie c0:25:06:cf:0c:d7 -69  11      Y  DE WPA2(PSK/AES/AES)</syntaxhighlight>
```
+
For &lt;=10.6 use a different command.
 
 
For <=10.6 use a different command.
 
 
 
```console
 
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --associate=XXX --bssid=YYY
 
```
 
 
 
  
## Downgrade from High Sierra to Sierra
+
<syntaxhighlight lang="console">/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --associate=XXX --bssid=YYY</syntaxhighlight>
 +
<span id="downgrade-from-high-sierra-to-sierra"></span>
 +
== Downgrade from High Sierra to Sierra ==
  
 
https://www.imore.com/how-downgrade-macos
 
https://www.imore.com/how-downgrade-macos
  
Technically, a downgrade isn't possible from backup :-(
+
Technically, a downgrade isn’t possible from backup :-(
  
Erase a disk with the MacOS Extended (Journaled) format, with a name of `Untitled`.
+
Erase a disk with the MacOS Extended (Journaled) format, with a name of <code>Untitled</code>.
  
Create install media, using `/Volume/Untitled` as destination volume.
+
Create install media, using <code>/Volume/Untitled</code> as destination volume.
  
- The volume will again be erased, so it is OK to use the old volume name.
+
* The volume will again be erased, so it is OK to use the old volume name.
- The `--applicationpath` must be the **fully qualified path**.
+
* The <code>--applicationpath</code> must be the '''fully qualified path'''.
  
```console
+
<syntaxhighlight lang="console">$ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
$ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
 
 
   --volume /Volumes/Untitled \
 
   --volume /Volumes/Untitled \
 
   --applicationpath "/Applications/Install macOS Sierra.app"
 
   --applicationpath "/Applications/Install macOS Sierra.app"
Line 1,086: Line 1,034:
 
Copying boot files...
 
Copying boot files...
 
Copy complete.
 
Copy complete.
Done.
+
Done.</syntaxhighlight>
```
+
<span id="adjust-macos-font-smoothing"></span>
 +
== Adjust macOS font smoothing ==
  
## Adjust macOS font smoothing
+
<span id="font-smoothing"></span>
 
+
=== Font smoothing ===
### Font smoothing
 
  
 
https://software.com/mac/tweaks/change-font-smoothing
 
https://software.com/mac/tweaks/change-font-smoothing
Line 1,097: Line 1,045:
 
Display the current font smoothing:
 
Display the current font smoothing:
  
```console
+
<syntaxhighlight lang="console">$ defaults -currentHost read -globalDomain AppleFontSmoothing</syntaxhighlight>
$ defaults -currentHost read -globalDomain AppleFontSmoothing
+
Change the font smoothing (0=off, 1=light, 2=Medium/flat panel, 3=strong/blurred) This is mostly needed for non-Apple displays. Restart applications to see the effect
```
 
 
 
Change the font smoothing (0=off, 1=light, 2=Medium/flat panel,
 
3=strong/blurred) This is mostly needed for non-Apple displays. Restart
 
applications to see the effect
 
 
 
```console
 
$ defaults -currentHost write -globalDomain AppleFontSmoothing -int 0
 
```
 
  
 +
<syntaxhighlight lang="console">$ defaults -currentHost write -globalDomain AppleFontSmoothing -int 0</syntaxhighlight>
 
Delete the setting completely (restore default)
 
Delete the setting completely (restore default)
  
```console
+
<syntaxhighlight lang="console">$ defaults -currentHost delete -globalDomain AppleFontSmoothing</syntaxhighlight>
$ defaults -currentHost delete -globalDomain AppleFontSmoothing
 
```
 
 
 
 
Set the font anti-aliasing minimum sizes, globally or per-application:
 
Set the font anti-aliasing minimum sizes, globally or per-application:
  
```
+
<pre>$ defaults -currentHost write .GlobalPreferences AppleSmoothFontsSizeThreshold -int 16
$ defaults -currentHost write .GlobalPreferences AppleSmoothFontsSizeThreshold -int 16
 
 
$ defaults -currentHost write .GlobalPreferences AppleFontSmoothing -int 0
 
$ defaults -currentHost write .GlobalPreferences AppleFontSmoothing -int 0
$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16
+
$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16</pre>
```
+
<span id="anti-aliasing"></span>
 
+
=== Anti-aliasing ===
### Anti-aliasing
 
  
 
Read the current value.
 
Read the current value.
  
```
+
<pre>$ defaults read NSGlobalDomain AppleAntiAliasingThreshold
$ defaults read NSGlobalDomain AppleAntiAliasingThreshold
+
4</pre>
4
+
The anti-aliasing can be configured per application. (https://ss64.com/osx/syntax-defaults.html)
```
 
 
 
The anti-aliasing can be configured per application.
 
(https://ss64.com/osx/syntax-defaults.html)
 
 
 
```
 
$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16
 
```
 
  
# Misc
+
<pre>$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16</pre>
 +
<span id="misc"></span>
 +
= Misc =
  
## Commands looking at profile enrollment at work.
+
<span id="commands-looking-at-profile-enrollment-at-work."></span>
 +
== Commands looking at profile enrollment at work. ==
  
 
Profile enrollment of some sort?
 
Profile enrollment of some sort?
  
```
+
<pre>$ profiles status -type enrollment</pre>
$ profiles status -type enrollment
+
<pre>$ sudo profiles list
```
 
 
 
```
 
$ sudo profiles list
 
 
_computerlevel[1] attribute: profileIdentifier: com.google.corp.gmac.applicationaccess
 
_computerlevel[1] attribute: profileIdentifier: com.google.corp.gmac.applicationaccess
 
_computerlevel[2] attribute: profileIdentifier: com.google.corp.gmac.chrome.extension.passwordalert
 
_computerlevel[2] attribute: profileIdentifier: com.google.corp.gmac.chrome.extension.passwordalert
Line 1,168: Line 1,094:
 
_computerlevel[16] attribute: profileIdentifier: com.google.corp.gmac.spotlight
 
_computerlevel[16] attribute: profileIdentifier: com.google.corp.gmac.spotlight
 
_computerlevel[17] attribute: profileIdentifier: com.google.corp.gmac.prefpanes
 
_computerlevel[17] attribute: profileIdentifier: com.google.corp.gmac.prefpanes
There are 17 system configuration profiles installed
+
There are 17 system configuration profiles installed</pre>
```
+
<pre>$ sudo profiles show -type enrollment
 
 
```
 
$ sudo profiles show -type enrollment
 
 
Device Enrollment configuration:
 
Device Enrollment configuration:
 
{
 
{
 
     AllowPairing = 1;
 
     AllowPairing = 1;
 
     AwaitDeviceConfigured = 1;
 
     AwaitDeviceConfigured = 1;
     ConfigurationURL = "https://emmapplecodevice.googleapis.com/v1/_/deviceserver/C02h8e9nw/setup?key=AIzaSyAdMVj0IzE7K6u90EkdmoVTc_79_hO1i5w";
+
     ConfigurationURL = &quot;https://emmapplecodevice.googleapis.com/v1/_/deviceserver/C02h8e9nw/setup?key=AIzaSyAdMVj0IzE7K6u90EkdmoVTc_79_hO1i5w&quot;;
 
     IsMDMUnremovable = 0;
 
     IsMDMUnremovable = 0;
 
     IsMandatory = 1;
 
     IsMandatory = 1;
 
     IsSupervised = 1;
 
     IsSupervised = 1;
     OrganizationAddress = "1600 Amphitheatre Parkway, n/a, , Mountain VIew, CA 94043";
+
     OrganizationAddress = &quot;1600 Amphitheatre Parkway, n/a, , Mountain VIew, CA 94043&quot;;
     OrganizationAddressLine1 = "1600 Amphitheatre Parkway";
+
     OrganizationAddressLine1 = &quot;1600 Amphitheatre Parkway&quot;;
     OrganizationAddressLine2 = "n/a";
+
     OrganizationAddressLine2 = &quot;n/a&quot;;
     OrganizationCity = "Mountain VIew";
+
     OrganizationCity = &quot;Mountain VIew&quot;;
 
     OrganizationCountry = USA;
 
     OrganizationCountry = USA;
     OrganizationEmail = "abma@google.com";
+
     OrganizationEmail = &quot;abma@google.com&quot;;
     OrganizationName = "Google LLC";
+
     OrganizationName = &quot;Google LLC&quot;;
 
     OrganizationPhone = 12125658743;
 
     OrganizationPhone = 12125658743;
 
     OrganizationZipCode = 94043;
 
     OrganizationZipCode = 94043;
Line 1,195: Line 1,118:
 
         iCloudDiagnostics
 
         iCloudDiagnostics
 
     );
 
     );
}
+
}</pre>
```
+
<span id="kernel-extensions"></span>
 +
== Kernel extensions ==
  
## Kernel extensions
+
Get list of approved kernel extensions (e.g. TripMode and Intel Power).
  
Get list of approved kernel extensions (e.g. TripMode and Intel Power).
+
<pre>$ echo 'select * from kext_policy; ' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
 
 
```
 
$ echo 'select * from kext_policy; ' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
 
 
78UFGP42EU|ch.tripmode.TripModeNKE|1|Ludovic LEGER|1
 
78UFGP42EU|ch.tripmode.TripModeNKE|1|Ludovic LEGER|1
Z3L495V9L4|com.intel.driver.EnergyDriver|1|Intel Corporation Apps|1
+
Z3L495V9L4|com.intel.driver.EnergyDriver|1|Intel Corporation Apps|1</pre>
```
+
<pre>$ echo 'select * from kext_policy_mdm;' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
 
 
```
 
$ echo 'select * from kext_policy_mdm;' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
 
 
EQHXZ8M8AV||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
 
EQHXZ8M8AV||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
 
P8DQRXPVLP||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
 
P8DQRXPVLP||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
 
X9E956P446||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
 
X9E956P446||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
3T5GSNBU6W|com.github.osxfuse.filesystems.osxfuse|1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
+
3T5GSNBU6W|com.github.osxfuse.filesystems.osxfuse|1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319</pre>
```
+
<syntaxhighlight lang="console">$ cat /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
 
 
```console
 
$ cat /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<plist version="1.0">
 
<plist version="1.0">
 
<dict>
 
<dict>
<key>CloudConfigProfile</key>
+
    <key>CloudConfigProfile</key>
<dict>
+
    <dict>
<key>AllowPairing</key>
+
        <key>AllowPairing</key>
<true/>
+
        <true/>
 
...
 
...
 
   </dict>
 
   </dict>
 
</dict>
 
</dict>
</plsit>
+
</plsit></syntaxhighlight>
```
+
<span id="code-signing"></span>
 
+
== Code signing ==
## Code signing
 
  
 
Get code signing information about an app.
 
Get code signing information about an app.
  
```
+
<pre>$ codesign -dvv /Applications/ESET\ Endpoint\ Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext
$ codesign -dvv /Applications/ESET\ Endpoint\ Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext
 
 
Executable=/Applications/ESET Endpoint Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext/Contents/MacOS/esets_kac_64_109
 
Executable=/Applications/ESET Endpoint Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext/Contents/MacOS/esets_kac_64_109
 
Identifier=com.eset.kext.esets-kac
 
Identifier=com.eset.kext.esets-kac
Line 1,250: Line 1,163:
 
TeamIdentifier=P8DQRXPVLP
 
TeamIdentifier=P8DQRXPVLP
 
Sealed Resources version=2 rules=13 files=1
 
Sealed Resources version=2 rules=13 files=1
Internal requirements count=1 size=36
+
Internal requirements count=1 size=36</pre>
```
+
<span id="powerchime"></span>
 
+
== PowerChime ==
## PowerChime
 
  
 
The new MacBook Pro machine chimes when it gets power. Annoying??
 
The new MacBook Pro machine chimes when it gets power. Annoying??
  
- https://apple.stackexchange.com/questions/265759/how-to-disable-plug-in-sound-on-late-2016-macbook-pro/265763#265763
+
* https://apple.stackexchange.com/questions/265759/how-to-disable-plug-in-sound-on-late-2016-macbook-pro/265763#265763
- https://apple.stackexchange.com/questions/282752/turning-power-chime-off
+
* https://apple.stackexchange.com/questions/282752/turning-power-chime-off
  
## Set static route, and make persistent on boot
+
<span id="set-static-route-and-make-persistent-on-boot"></span>
 +
== Set static route, and make persistent on boot ==
  
 
https://apple.stackexchange.com/questions/219834/how-to-set-network-devices-priority-on-afp-smb-transfers
 
https://apple.stackexchange.com/questions/219834/how-to-set-network-devices-priority-on-afp-smb-transfers
Line 1,266: Line 1,179:
 
In the example below I assume the Ethernet router has the IP 192.168.0.1 and the network behind the router is the 192.168.56.0/24 network.
 
In the example below I assume the Ethernet router has the IP 192.168.0.1 and the network behind the router is the 192.168.56.0/24 network.
  
```
+
<pre>sudo route add -net 192.168.56.0  192.168.0.1</pre>
sudo route add -net 192.168.56.0  192.168.0.1
 
```
 
 
 
 
To make this route persistent add a launch daemon on your machines:
 
To make this route persistent add a launch daemon on your machines:
  
```
+
<pre>sudo nano /Library/LaunchDaemons/local.staticroute.shares.plist</pre>
sudo nano /Library/LaunchDaemons/local.staticroute.shares.plist
 
```
 
 
 
 
with the content
 
with the content
  
```xml
+
<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
 
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<plist version="1.0">
 
<plist version="1.0">
Line 1,296: Line 1,202:
 
     <true/>
 
     <true/>
 
   </dict>
 
   </dict>
</plist>
+
</plist></syntaxhighlight>
```
 
 
 
 
Save the file (Ctrl-O) and quit Nano (Ctrl-X).
 
Save the file (Ctrl-O) and quit Nano (Ctrl-X).
  
 
Load the launch daemon with:
 
Load the launch daemon with:
  
```
+
<pre>sudo launchctl load -w /Library/LaunchDaemons/local.staticroute.shares.plist</pre>
sudo launchctl load -w /Library/LaunchDaemons/local.staticroute.shares.plist
 
```
 
 
 
 
To access the shares enter afp://192.168.56.x, cifs://192.168.56.x or smb://192.168.56.x (with x= the last octet of the IP address of the share).
 
To access the shares enter afp://192.168.56.x, cifs://192.168.56.x or smb://192.168.56.x (with x= the last octet of the IP address of the share).
  
## Open System Preferences as root
+
<span id="open-system-preferences-as-root"></span>
 
+
== Open System Preferences as root ==
```shell
 
sudo /System/Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences
 
```
 
  
## macOS Big Sur
+
<syntaxhighlight lang="shell">sudo /System/Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences</syntaxhighlight>
 +
<span id="macos-big-sur"></span>
 +
== macOS Big Sur ==
  
### Change the menu bar date/time format
+
<span id="change-the-menu-bar-datetime-format"></span>
 +
=== Change the menu bar date/time format ===
  
 
Update the format using Terminal.
 
Update the format using Terminal.
  
```
+
<pre>defaults write com.apple.menuextra.clock DateFormat -string &quot;EEE d MMM h:mm a&quot;</pre>
defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm a"
+
My prefered version of the command. NOTE: spaces aren’t needed.
```
 
 
 
My prefered version of the command. NOTE: spaces aren't needed.
 
  
```
+
<pre>defaults write com.apple.menuextra.clock DateFormat -string &quot;EMdhhmmss&quot;</pre>
defaults write com.apple.menuextra.clock DateFormat -string "EMdhhmmss"
+
<span id="system-extensions"></span>
```
+
=== System Extensions ===
 
 
### System Extensions
 
  
 
Get list of loaded extensions.
 
Get list of loaded extensions.
  
```
+
<pre>$ kmutil showloaded</pre>
$ kmutil showloaded
 
```
 
 
 
 
Get list of loaded auxillary extensions.
 
Get list of loaded auxillary extensions.
  
```
+
<pre>$ kmutil showloaded --collection auxiliary</pre>
$ kmutil showloaded --collection auxiliary
+
<span id="macos-catalina"></span>
```
+
== macOS Catalina ==
  
## macOS Catalina
+
<span id="remove-default-interactive-warning-for-bash."></span>
 +
=== Remove “default interactive” warning for bash. ===
  
### Remove "default interactive" warning for bash.
+
macOS Catalina ships with zsh as the default shell for licensing reasons. To notify users, a warning is presented each time a bash interactive shell is started.
  
macOS Catalina ships with zsh as the default shell for licensing reasons. To
+
<pre>The default interactive shell is now zsh.
notify users, a warning is presented each time a bash interactive shell is
 
started.
 
 
 
```
 
The default interactive shell is now zsh.
 
 
To update your account to use zsh, please run `chsh -s /bin/zsh`.
 
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
+
For more details, please visit https://support.apple.com/kb/HT208050.</pre>
```
+
To disable the warning, add this to <code>~/.bash_profile</code> or equivalent.
 
 
To disable the warning, add this to `~/.bash_profile` or equivalent.
 
  
```
+
<pre>export BASH_SILENCE_DEPRECATION_WARNING=1</pre>
export BASH_SILENCE_DEPRECATION_WARNING=1
 
```
 

Revision as of 20:34, 28 December 2021

Stuff for macOS and OS X

INFO: [2020-11-19] These notes aren’t fully formatted yet as I’ve simply copied them from my personal notes. I’ll fix them with time.

References

http://serverfault.com/questions/7346/what-are-useful-command-line-commands-on-mac-os-x

Keyboard Shortcut Symbols

Back up and share text replacements on Mac

Symbols

Common symbols used by macOS.

Description Symbol Note
Apple ⌘-Option-K (works on a Mac, but might be different on other OSes)
Command
Delete
Escape ⎋ / ␛
Fn-Down
Fn-Left ↖︎
Fn-Right ↘︎
Fn-Up
Option
Power substitute as there isn’t a good one; http://unicodepowersymbol.com/
Return
Shift
Tab

Accents

Method 1: To type an accented or alternate version of a character, hold a key down until its alternate characters are displayed. (https://support.apple.com/en-us/HT201586)

Method 2: Request accent, then character. (http://symbolcodes.tlt.psu.edu/accents/codemac.html)

Method 3: Open Character Palette with Control-Command-Space. Find the desired character, then drag the character with the mouse into place to insert.

Name Example Shortcut + Char
Acute ó Ó Option-E, V
Circumflex ô Ô Option-I, V
Grave ò Ò Option-`, V
Tilde õ Õ Option-N, V (only works with a, n, and o)
Umlaut ö Ö Option-U, V

Letters

Letter Shortcut Description
å Option-A
ç Option-C
ø Option-O
ß Option-S Eszett
æ Option-’

Math Symbols

Approximately : (≈) Option-X Degree : (°) Shift-Option-8 Delta : (∆) Option-J Division : (÷) Option-/ GreaterOrEqual : (≥) Option-. Infinity : (∞) Option-5 Intergal : (∫) Option-B LessOrEqual : (≤) Option-, Micro : (µ) Option-M Ohm : (Ω) Option-Z PartialDerivative : (∂) Option-D PerMil : (‰) Shift-Option-R Pi : (π) Option-P Plus/Minus : (±) Shift-Option-= ProductPi : (∏) Shift-Option-P SquareRoot : (√) Option-V Sum : (∑) Option-W

Punctuation

Copyright : (©) Option+G Dagger : (†) Option+T Dot : (•) Option+8 EmDash : (—) Option+Shift+- EnDash : (–) Option+- Paragraph : (¶) Option+7 Registered : (®) Option+R Section : (§) Option+6 Trademark : (™) Option+2

General

Command-F2 : Act as external display on iMac Command-Delete : Delete a file Command-Shift-3 : Capture screen Command-Shift-4 : Capture window with cursor selection Command-Shift-4 + Space : Capture window Command-Shift-5 : Record cropped window Command-Shift-5 + Space : Record a window Command-Shift-Q : Log out with confirmation Command-Shift-Option-Q : Log out without confirmation

Documents

Key combination Description
⌘-B Boldface the selected text, or turn boldfacing on or off.
⌘-Option-C Copy Style: Copy the formatting settings of the selected item to the Clipboard.
⌘-D Select the Desktop folder from within an Open dialog or Save dialog.
⌘-Control-D Show or hide the definition of the selected word.
⌘-Option-F Go to the search field.
⌘-I Italicise the selected text, or turn italics on or off.
⌘-Option-I Show or hide the inspector window.
⌘-L During software installation, show a log of actions.
⌘-Shift-P Page setup: Display a window for selecting document settings.
⌘-Shift-S Display the ave As dialog, or duplicate the current document.
⌘-T Show or hide the Fonts window.
⌘-Option-T Show or hide a toolbar in the app.
⌘-U Underline the selected text, or turn underlining on or off.
⌘-Option-V Paste Style: Apply the copied style to the selected item.
⌘-Option-Shift-V Paste and Match Style: Apply the style of the surrounding content to the item pasted within that content.
⌘-; Fix misspelled words in the document.
⌘-Shift-: Display the Spelling and Grammar window
⌘-⌫ Select Delete or Don’t Save in a dialog that contains a Delete or Don’t Save button.

Command–DownArrow : Move the insertion point to the end of the document. Command–Equal : … performs the same function. Command–LeftArrow : Move the insertion point to the beginning of the current line. Command–LeftCurlyBracket : Left align. Command–RightArrow : Move the insertion point to the end of the current line. Command–RightCurlyBracket : Right align. Command–Shift–DownArrow : Select the text between the insertion point and the end of the document. Command–Shift–LeftArrow : Select the text between the insertion point and the beginning of the current line. Command–Shift–Minus : Decrease the size of the selected item. Command–Shift–Plus : Increase the size of the selected item. Command–Shift–QuestionMark : Open the Help menu. Command–Shift–RightArrow : Select the text between the insertion point and the end of the current line. Command–Shift–UpArrow : Select the text between the insertion point and the beginning of the document. Command–Shift–VerticalBar : Center align. Command–UpArrow : Move the insertion point to the beginning of the document. Control-A : Move to the beginning of the line or paragraph. Control-B : Move one character backward. Control-D : Delete the character to the right of the insertion point. Or use Fn-Delete. Control-E : Move to the end of a line or paragraph. Control-F : Move one character forward. Control-H : Delete the character to the left of the insertion point. Or use Delete. Control-K : Delete the text between the insertion point and the end of the line or paragraph. Control-L : Center the cursor or selection in the visible area. Control-N : Move down one line. Control-O : Insert a new line after the insertion point. Control-P : Move up one line. Control-T : Swap the character behind the insertion point with the character in front of the insertion point. Fn-Delete : Forward delete on keyboards that don’t have a Forward Delete key. Or use Control-D. Fn–DownArrow : Page Down: Scroll down one page. Fn–LeftArrow : Home: Scroll to the beginning of a document. Fn–RightArrow : End: Scroll to the end of a document. Fn–UpArrow : Page Up: Scroll up one page. Option-Delete : Delete the word to the left of the insertion point. Option–LeftArrow : Move the insertion point to the beginning of the previous word. Option–RightArrow : Move the insertion point to the end of the next word. Shift–DownArrow : Extend text selection to the nearest character at the same horizontal location on the line below. Shift–LeftArrow : Extend text selection one character to the left. Shift–Option–DownArrow : Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again. Shift–Option–LeftArrow : Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again. Shift–Option–RightArrow : Extend text selection to the end of the current word, then to the end of the following word if pressed again. Shift–Option–UpArrow : Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again. Shift–RightArrow : Extend text selection one character to the right. Shift–UpArrow : Extend text selection to the nearest character at the same horizontal location on the line above.

Booting

https://support.apple.com/en-eg/HT201255 http://www.tech-recipes.com/rx/2818/os_x_ten_boot_options_for_leopard/

Key Desc
C Boot from CD/DVD
D / Option-D Diagnostics or Apple Hardware Test mode / via-Internet. 1) Unplug MacBook Pro from power, and fully power off the machine. 2) Power on and press-and-hold the D key. 3) Release when prompted to choose a language.
N Netboot
R PowerBook Display Reset
T Target disk mode
X Startup from OS X instead of from non-OS X startup
⌘-Option-P-R Reset PRAM. Do immediately after powering on, and release after 2nd Apple logo or 20sec, whichever comes first.
⌘-R / ⌘-Option-R OS X Recovery / over the Internet
Command-S Single User Mode
Command-V Verbose Boot
LeftShift-Control-Option-Power Reset SMC. Do with power off. Hold for 10 sec, then power on again.
Left_Mouse / F12 / mouse_button / trackpad_button Eject Media
Option Startup Manager
Option-D Diagnostics or Apple Hardware Test via Internet
Option-N NetBoot using default image
Shift Safe Mode

Downloads

How to create a bootable installer for macOS

10.15 Catalina

sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume

10.14 Mojave

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume

10.13 High Sierra

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume

10.12 Yosemite

10.11 El Capitan

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume \
  --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

10.10 Sierra

$ sudo /Applications/Install\ OS\ X\ Sierra.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume \
  --applicationpath /Applications/Install\ OS\ X\ Sierra.app

10.9 Maverics

$ sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia \
  --volume /Volumes/MyVolume \
  --applicationpath /Applications/Install\ OS\ X\ Mavericks.app

Legacy

See also: https://appleinsider.com/articles/19/11/23/how-to-get-an-old-macos-installer-from-apple

File systems

Create ISO from CDR

https://forums.macrumors.com/threads/converting-cdr-to-iso.783690/

Convert a CDR to ISO.

<syntaxhighlight lang="console">$ hdiutil makehybrid -iso -joliet -o diskimage.iso diskimage.cdr</syntaxhighlight>

Write ISO to USB

For bootable images, use one of:

  • Etcherrecommended for bootable CD/DVD
  • UNetbootin – useful if additional FreeDOS boot is needed (e.g. for firmware upgrades)

For data only…

https://snipt.net/w00kie/how-do-i-burn-an-iso-on-a-usb-drive-on-mac-os-x/

Convert the file to a Disk Image. Note a .dmg extension will be added.

<syntaxhighlight lang="console">$ hdiutil convert -format UDRW -o /path/to/target /path/to/original.iso</syntaxhighlight> Find current devices

<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight> Unmount device

<syntaxhighlight lang="console">$ diskutil unmountDisk /dev/diskN</syntaxhighlight> Write to USB

<syntaxhighlight lang="console">$ sudo dd if=/path/to/target.dmg of=/dev/rdiskN bs=1m</syntaxhighlight> Eject the disk

<syntaxhighlight lang="console">$ diskutil eject /dev/diskN</syntaxhighlight>

Format a disk from the command-line

Format with JHFS+ (Journaled HFS+) with a GPT partition layout.

diskutil eraseDisk jhfs+ "ICY BOX 500G" gpt /dev/diskX

Create custom CoreStorage drive

http://www.cnet.com/how-to/how-to-make-a-custom-corestorage-drive-in-os-x/

Create a CoreStorage volume. Will be using disk0 (SSD) and disk1 (HDD).

Partition all drives to be part of CS with single GUID partition, named ‘Untitled’. Then determine their drive names

<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight> Create the logical volume group. Note the 1st drive is the SSD drive, and 2nd is drive is the HDD.

<syntaxhighlight lang="console">$ diskutil cs create Macintosh\ LVG disk0 disk1</syntaxhighlight> List CS volumes

<syntaxhighlight lang="console">$ diskutil cs list</syntaxhighlight> Create volume in the volume group using UUID of LVG

<syntaxhighlight lang="console">$ diskutil cs createVolume UUID jhfs+ Macintosh\ HD 100%</syntaxhighlight> If desired, encrypt the logical volume just created

<syntaxhighlight lang="console">$ diskutil cs list $ diskutil cs encryptVolume UUID</syntaxhighlight> Delete a CS LVG.

<syntaxhighlight lang="console">$ diskutil cs delete UUID</syntaxhighlight>

Get serial number of drive

<syntaxhighlight lang="console">$ ioreg -l |less</syntaxhighlight>

ditto

Mirror directories in OS X, preserving all ownership and permission data.

<syntaxhighlight lang="console"># ditto -V /Users /Volumes/SecondaryHD/Users</syntaxhighlight>

Write DMG to disk

http://coolestguyplanettech.com/downtown/how-image-mac-os-x-107-lion-command-lineterminal

  1. Mount the destination drive
  2. Issue this command, replacing source and destination paths

<syntaxhighlight lang="console">$ asr restore \ --source /path-to-source-dmg-image \ --target /Volumes/path-to-destination-volume \ --erase \ --format HFS+ \ --noverify</syntaxhighlight>

  • The –erase will erase the destination format
  • The –format is optional and only required if the destination needs to be reformatted
  • The –noverify is optional and skips verification - but obviously doesn’t verify a successful restore.

Mount DMG as disk – loopback

http://apple.stackexchange.com/questions/9284/does-mac-have-something-similar-to-a-linux-loop-device

The upgrade from MacOS 10.12.1 to 10.12.2 broke my APFS formatted Ableton SDCard drive. Ugh :-(. Luckily I still had a machine running 10.12.1, so I figured I’d try to fix things.

I started by dumping the raw disk /dev/disk2 using dd.

<syntaxhighlight lang="console">$ dd if=/dev/disk2 of=/Volumes/Samsung_T1/Ableton-d2.dmg bs=1m</syntaxhighlight> Mount the disk. Note: I could have added the -nomount option after attach to have prevented the disk from actually mounting.

<syntaxhighlight lang="console">$ hdiutil attach /Volumes/Samsung_T1/Ableton-d2.dmg /dev/disk2 GUID_partition_scheme /dev/disk2s1 EFI /dev/disk2s2 Apple_APFS /dev/disk2s2s1 41504653-0000-11AA-AA11-0030654</syntaxhighlight> Yay!

APFS

Sparse image

Create a sparse image with APFS.

<syntaxhighlight lang="console">$ hdiutil create -fs APFS -size 1GB foo.sparseimage</syntaxhighlight> Physical disk

Partition the disk

<syntaxhighlight lang="console">$ sudo diskutil partitionDisk disk2 APFS Untitled 100%</syntaxhighlight> Existing partition

Create APFS container.

<syntaxhighlight lang="console">$ diskutil apfs createContainer /dev/disk2s2</syntaxhighlight> Create APFS volume in an APFS container.

<syntaxhighlight lang="console">$ diskutil apfs addVolume disk2s2 APFS newAPFS</syntaxhighlight> FSCK.

<syntaxhighlight lang="console">$ fsck_apfs /dev/disk2s2</syntaxhighlight>

NFS

Change default behavior to work better with Linux servers.

/etc/nfs.conf

# Generated automatically by NFS Manager 2016-10-19 23:06:36 +0000
nfs.client.allow_async = 1
nfs.client.nfsiod_thread_max = 128
nfs.client.mount.options = nfc,intr
nfs.client.is_mobile = 0

Restart autofs without rebooting.

Use the automount command.

<syntaxhighlight lang="console">$ sudo automount -vc</syntaxhighlight> Alternatively, use launchctl.

<syntaxhighlight lang="console">$ sudo launchctl stop com.apple.autofsd</syntaxhighlight>

Partitioning

References

Get list of info

<syntaxhighlight lang="console">$ diskutil list</syntaxhighlight> Format an entire drive as APFS

<syntaxhighlight lang="console"># command verb disk boot_record filesystem name size $ diskutil partitionDisk /dev/diskX GPT APFS NewName 0b</syntaxhighlight> Arguments:

  • Boot Records
    • GPT (GUID Partition Table)
    • MBR (Master Boot Record)
  • Filesystems
    • APFS (Apple File System – beta in Sierra 10.12.1)
    • ExFAT
    • FAT32
    • HFS+ (Apple HFS+)

Locked files or folders

Look at the current flags:

<syntaxhighlight lang="console">$ ls -lO /path/to/folder</syntaxhighlight> Unlock them with:

<syntaxhighlight lang="console">$ chflags nouchg /path/to/locked/folder</syntaxhighlight> or with:

<syntaxhighlight lang="console">$ SetFile -a l /path/to/locked/folder</syntaxhighlight>

Cookbook

Homebrew

The ftp and telnet are no longer included with macOS, but can be installed with Brew.

$ brew install inetutils

Resize a sparse bundle

Unmount the image, and follow commands below.

Compact the image (size stays the same).

hdiutil compact filename.sparsebundle

Increase the size of the image (e.g. 8G to 12G).

hdiutil resize -size 12G filename.sparsebundle

Paragraph Sorting Service

http://www.macosxautomation.com/services/learn/tut03/index.html

  1. Open Automator.
  2. Create a new “Service” workflow.
  3. Configure workflow.
    1. Service receives selected > text
    2. in > any application
    3. check < Replaces selected text

Disable the Swoosh animation for Mac OS X Spaces

macOS [10.12)

System Preferences > Accessibility > Display > Reduce motion

macOS (10.11]

<syntaxhighlight lang="console">$ defaults write com.apple.dock \

  workspaces-swoosh-animation-off \
  -bool YES &&
  killall Dock</syntaxhighlight>

Change screen capture behavior.

Disable shadow on screen capture.

$ defaults write com.apple.screencapture disable-shadow -bool TRUE
$ killall SystemUIServer

Change the location of screen captures.

$ defaults write com.apple.screencapture location ~/Pictures/Screenshots

Change the prefix of the screen capture filename.

$ defaults write com.apple.screencapture name "Pretty Picture"
$ killall SystemUIServer

Take a screen capture as PDF (PNG is default).

$ defaults write com.apple.screencapture type pdf

(En|Dis)able Bonjour Announcements (10.5+)

Disable

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Enable

$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

To leave it enabled, but not announce things via multicast DNS, edit the plist and add this line to the mDNSResponder options.

<string>-NoMulticastAdvertisements</string>

Time Machine

Change backup frequency (10.5+) http://hints.macworld.com/article.php?story=200710291721156

Edit /System/Library/LaunchDaemons/com.apple.backupd-auto.plist and update the StartInterval setting. 3600[s] is 1h.

Cron’d stuff

See entry at Oct 19, ’10 08:03:30PM in http://hints.macworld.com/article.php?story=200710291721156

Sleep

Sleep machine from command-line (10.5+)

$ pmset sleepnow

pmset

See ‘man pmset’ for more info. For 10.4 and prior, see http://www.snoize.com/SleepNow/.

Figure out why machine isn’t sleeping.

$ pmset -g assertions

Log sleep/wake messages

$ pmset -g pslog

View the logs later

$ pmset -g

(En|Dis)able swap

http://hints.macworld.com/article.php?story=201106020948369

Disable

<syntaxhighlight lang="console">$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist $ sudo rm /private/var/vm/swapfile*</syntaxhighlight> Enable

<syntaxhighlight lang="console">$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist</syntaxhighlight>

SMART

http://hints.macworld.com/article.php?story=20031122041138373

Get SMART status from the command-line

<syntaxhighlight lang="console"># diskutil list

  1. diskutil info diskX |grep SMART</syntaxhighlight>

sysctl

Performance Tuning the Network Stack Mac OS X

Versions: [10.5-10.8)

Put data into /etc/sysctl.conf.

kern.ipc.maxsockbuf=4194304
kern.ipc.somaxconn=512
kern.ipc.nmbclusters=2048
net.inet.tcp.rfc1323=1
net.inet.tcp.win_scale_factor=3
net.inet.tcp.sockthreshold=16
net.inet.tcp.sendspace=262144
net.inet.tcp.recvspace=262144
net.inet.tcp.mssdflt=1440
net.inet.tcp.msl=15000
net.inet.tcp.always_keepalive=0
net.inet.tcp.delayed_ack=0
net.inet.tcp.slowstart_flightsize=4
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.icmp.icmplim=50

Change these values for [10.8)

kern.ipc.maxsockbuf=8388608

# Enable support for 9000+ byte packets.
# https://blah.cloud/hardware/test-jumbo-frames-working/
net.inet.raw.maxdgram=16384

(old) Recommended values for /etc/sysctl.conf.

key default recommended notes
net.inet.tcp.mssdflt 512 1440
net.inet.tcp.win_scale_factor 3 10
net.inet.tcp.sendspace 65536 2097152 1/2 of kern.ipc.maxsockbuf
net.inet.tcp.recvspace 65536 2097152 1/2 of kern.ipc.maxsockbuf

Spotlight

Check status of Spotlight

<syntaxhighlight lang="console"># mdutil -s /</syntaxhighlight> Enable Spotlight

<syntaxhighlight lang="console"># mdutil -i on /</syntaxhighlight> Rebuilt database

<syntaxhighlight lang="console"># mdutil -E /</syntaxhighlight>

Restart Finder from the Terminal

http://thewayeye.net/2012/january/4/how-restart-finder-terminal

Kill Finder

<syntaxhighlight lang="console">$ sudo killall Finder</syntaxhighlight> Manually start if it doesn’t automatically

<syntaxhighlight lang="console">$ open /System/Library/CoreServices/Finder.app</syntaxhighlight> If all else fails, reboot

<syntaxhighlight lang="console">$ shutdown -r</syntaxhighlight>

Extract contents of a Payload file

These are basically compressed cpio files.

<syntaxhighlight lang="console">$ cat Payload |gzip -d |cpio -id</syntaxhighlight>

Firewall

List apps allowed/blocked by firewall.

<syntaxhighlight lang="console">$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listapps</syntaxhighlight>

dtrace and other scripts

http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/

Power management

Get history of power management events

<syntaxhighlight lang="console">$ pmset -g log |less</syntaxhighlight>

Icon sets

http://blog.macsales.com/28492-create-your-own-custom-icons-in-10-7-5-or-later

Create PNG files.

Filename Image Size (in pixels)
icon_512x512@2x.png 1024 x 1024
icon_512x512.png 512 x 512
icon_256x256@2x.png 512 x 512
icon_256x256.png 256 x 256
icon_128x128@2x.png 256 x 256
icon_128x128.png 128 x 128
icon_32x32@2x.png 64 x 64
icon_32x32.png 32 x 32
icon_16x16@2x.png 32 x 32
icon_16x16.png 16 x 16

Create an myicon.iconset folder, and put all files in that folder.

Create a myicon.icns file.

<syntaxhighlight lang="console">$ iconutil -c icns /path/to/myicon.iconset</syntaxhighlight> Get info about the drive / file, and copy the myicon.icns file over the drive icon of the file.

Kill parentalcontrolsd regularly

Create the following plist as /Library/LaunchDaemons/com.forestent.noparentalcontrolsd with root as owner.

<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>

 <key>Label</key>
 <string>com.stevenlin.antiparent</string>
 <key>ProgramArguments</key>
 <array>
   <string>/bin/launchctl</string>
   <string>kill</string>
   <string>SIGSTOP</string>
   <string>system/com.apple.familycontrols</string>
 </array>
 <key>Nice</key>
 <integer>1</integer>
 <key>StartInterval</key>
 <integer>600</integer>
 <key>RunAtLoad</key>
 <true/>

</dict> </plist></syntaxhighlight> Load the plist.

<syntaxhighlight lang="console">$ sudo launchctl load /Library/LaunchDaemons/com.forestent.noparentalcontrolsd</syntaxhighlight>

Install a package from the command-line

Use /usr/sbin/installer.

<syntaxhighlight lang="console">$ sudo installer -pkg /path/to/package.pkg -target /</syntaxhighlight>

sudo installer -pkg macOSUpd10.14.3.pkg -target / -verboseR -dumplog 2>&1 |tee ~/var/log/macOSUpd10.14.3.log

Upgrade software from the command-line

Use softwareupdate.

<syntaxhighlight lang="console">$ softwareupdate -l Software Update Tool

Fining available software</syntaxhighlight> If the updater is hitting problems, e.g. unable to contact update servers, consider resetting the catalogs. (Was needed for 10.14.3 at Google.)

<syntaxhighlight lang="shell">sudo softwareupdate --clear-catalog</syntaxhighlight>

Change visibility of hidden folders

Use /usr/bin/chflags.

$ chflags nohidden ~/Library

Force RGB Mode (a.k.a. fix horrible fonts)

http://www.iphonetopics.com/force-rgb-mode-in-mac-os-x/

Misc. Utilities

Expansion Slot Utility

The utility is located in /System/Library/CoreServices and is used to configure the performance of the PCI slots.

Fonts

https://discussions.apple.com/thread/3646002?tstart=0 http://www.thexlab.com/faqs/undofontbook.html http://www.jklstudios.com/misc/osxfonts.htm

pmset

Get the current settings

<syntaxhighlight lang="console">$ pmset -g System-wide power settings: Currently in use:

standby              1
Sleep On Power Button 1
womp                 0
autorestart          0
hibernatefile        /var/vm/sleepimage
powernap             1
gpuswitch            2
networkoversleep     0
disksleep            10
sleep                60 (sleep prevented by backupd, AddressBookSourceSync, nsurlsessiond, nsurlsessiond, nsurlsessiond, nsurlsessiond, nsurlsessiond)
autopoweroffdelay    28800
hibernatemode        0
autopoweroff         1
ttyskeepawake        1
displaysleep         60
standbydelay         10800</syntaxhighlight>

autopoweroff

This is the reason my 2013 Mac Pro wakes so slowly from sleep each morning.

https://support.apple.com/en-us/HT201635

autopoweroff is enabled by default on supported platforms as an implementation of Lot 6 to the European Energy-related Products Directive. After sleeping for autopoweroffdelay seconds, the system will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will take longer than wakeups from regular sleep.

bputil

https://keith.github.io/xcode-man-pages/bputil.1.html

Utility to precisely modify the security settings on Apple Silicon Macs

trustd

https://sneak.berlin/20201112/your-computer-isnt-yours/

This makes requests to ocsp.apple.com each and every time an app is opened. Ugh.

Troubleshooting

https://github.com/upekkha/AppleHardwareTest

Previous shutdown cause

Look at the log on the command-line, and compare to documented causes can be found on this blog.

<syntaxhighlight lang="console">$ log show --predicate 'eventMessage contains "Previous shutdown cause:"' Skipping info and debug messages, pass --info and/or --debug to include. Filtering the log data using "eventMessage CONTAINS "Previous shutdown cause:"" Timestamp Thread Type Activity PID 2017-11-30 17:12:25.019394+0100 0x379 Default 0x0 0 kernel: (AppleSMC) Previous shutdown cause: 3 2017-12-06 18:16:46.306853+0100 0x3ff Default 0x0 0 kernel: (AppleSMC) Previous shutdown cause: 5

--------------------------------------------------------------------------------------------------------------------

Log - Default: 2, Info: 0, Debug: 0, Error: 0, Fault: 0 Activity - Create: 0, Transition: 0, Actions: 0</syntaxhighlight>

Mouse Lag

Try turning off the mouse, removing it from the Bluetooth preferences window, and repairing the device.

On the Mac Pro (Late 2013) model, Wi-Fi seems to interfere with the Bluetooth signal such that the mouse lags. Disable Wi-Fi if possible, or use a hardwired mouse.

DNS resolution

Get dump of resolvers

<syntaxhighlight lang="console">$ scutil --dns</syntaxhighlight>

Reset DNS cache

OS X <= 10.9.* && >= 10.10.4

<syntaxhighlight lang="console">$ sudo killall -HUP mDNSResponder</syntaxhighlight> OS X 10.10.0 - 10.10.3

<syntaxhighlight lang="console">$ sudo discoveryutil mdnsflushcache</syntaxhighlight>

Finder – “File is damaged”

Finder is reporting “File is damaged” and “Move to Trash” or “Unmount disk”. If you know the file is fine, remove the quarantine xattr, and try again.

<syntaxhighlight lang="console">$ xattr -d com.apple.quarantine /path/to/file</syntaxhighlight>

Cannot verify installer

http://www.macrumors.com/2016/03/03/older-os-x-installers-broken-by-certificate/

Installers downloaded before Feb 14 2016 will not validate because the certificate used to sign the installer expired. To work around the issue, quit out of the installer, set the date back, and rerun the installer.

<syntaxhighlight lang="console">$ date 0201010116</syntaxhighlight> Alternatively, a newer version of the installer can be downloaded. Unfortunately, older OS X installs won’t be available, so the date method must be used.

Look at available Wi-Fi networks

http://apple.stackexchange.com/questions/131852/how-do-you-force-a-5-ghz-wifi-connection

Scan for network BSSIDs.

<syntaxhighlight lang="console">/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport scan

                           SSID BSSID             RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
                        Valerie c0:25:06:cf:0c:d3 -78  100,+1  Y  DE WPA2(PSK/AES/AES)
                        Valerie c0:25:06:cf:0c:d7 -69  11      Y  DE WPA2(PSK/AES/AES)</syntaxhighlight>

For <=10.6 use a different command.

<syntaxhighlight lang="console">/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --associate=XXX --bssid=YYY</syntaxhighlight>

Downgrade from High Sierra to Sierra

https://www.imore.com/how-downgrade-macos

Technically, a downgrade isn’t possible from backup :-(

Erase a disk with the MacOS Extended (Journaled) format, with a name of Untitled.

Create install media, using /Volume/Untitled as destination volume.

  • The volume will again be erased, so it is OK to use the old volume name.
  • The --applicationpath must be the fully qualified path.

<syntaxhighlight lang="console">$ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \

 --volume /Volumes/Untitled \
 --applicationpath "/Applications/Install macOS Sierra.app"

Ready to start. To continue we need to erase the disk at /Volumes/Untitled. If you wish to continue type (Y) then press return: y Erasing Disk: 0%... 10%... 20%... 30%...100%... Copying installer files to disk... Copy complete. Making disk bootable... Copying boot files... Copy complete. Done.</syntaxhighlight>

Adjust macOS font smoothing

Font smoothing

https://software.com/mac/tweaks/change-font-smoothing

Display the current font smoothing:

<syntaxhighlight lang="console">$ defaults -currentHost read -globalDomain AppleFontSmoothing</syntaxhighlight> Change the font smoothing (0=off, 1=light, 2=Medium/flat panel, 3=strong/blurred) This is mostly needed for non-Apple displays. Restart applications to see the effect

<syntaxhighlight lang="console">$ defaults -currentHost write -globalDomain AppleFontSmoothing -int 0</syntaxhighlight> Delete the setting completely (restore default)

<syntaxhighlight lang="console">$ defaults -currentHost delete -globalDomain AppleFontSmoothing</syntaxhighlight> Set the font anti-aliasing minimum sizes, globally or per-application:

$ defaults -currentHost write .GlobalPreferences AppleSmoothFontsSizeThreshold -int 16
$ defaults -currentHost write .GlobalPreferences AppleFontSmoothing -int 0
$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16

Anti-aliasing

Read the current value.

$ defaults read NSGlobalDomain AppleAntiAliasingThreshold
4

The anti-aliasing can be configured per application. (https://ss64.com/osx/syntax-defaults.html)

$ defaults -currentHost write com.apple.safari AppleAntiAliasingThreshold -int 16

Misc

Commands looking at profile enrollment at work.

Profile enrollment of some sort?

$ profiles status -type enrollment
$ sudo profiles list
_computerlevel[1] attribute: profileIdentifier: com.google.corp.gmac.applicationaccess
_computerlevel[2] attribute: profileIdentifier: com.google.corp.gmac.chrome.extension.passwordalert
_computerlevel[3] attribute: profileIdentifier: com.google.corp.gmac.networkprofile
_computerlevel[4] attribute: profileIdentifier: com.google.corp.gmac.chrome.extensionsettings
_computerlevel[5] attribute: profileIdentifier: com.google.corp.gmac.bird
_computerlevel[6] attribute: profileIdentifier: com.google.mdm.profile.kext
_computerlevel[7] attribute: profileIdentifier: com.google.mdm.profile.initial
_computerlevel[8] attribute: profileIdentifier: com.google.corp.gmac.touchid
_computerlevel[9] attribute: profileIdentifier: com.google.corp.gmac.internetsharing
_computerlevel[10] attribute: profileIdentifier: com.google.corp.gmac.sparkle
_computerlevel[11] attribute: profileIdentifier: com.google.corp.gmac.management
_computerlevel[12] attribute: profileIdentifier: com.google.corp.gmac.restor
_computerlevel[13] attribute: profileIdentifier: com.google.corp.gmac.chrome.extension.detangle
_computerlevel[14] attribute: profileIdentifier: com.google.corp.gmac.chrome
_computerlevel[15] attribute: profileIdentifier: com.google.corp.gmac.santa
_computerlevel[16] attribute: profileIdentifier: com.google.corp.gmac.spotlight
_computerlevel[17] attribute: profileIdentifier: com.google.corp.gmac.prefpanes
There are 17 system configuration profiles installed
$ sudo profiles show -type enrollment
Device Enrollment configuration:
{
    AllowPairing = 1;
    AwaitDeviceConfigured = 1;
    ConfigurationURL = "https://emmapplecodevice.googleapis.com/v1/_/deviceserver/C02h8e9nw/setup?key=AIzaSyAdMVj0IzE7K6u90EkdmoVTc_79_hO1i5w";
    IsMDMUnremovable = 0;
    IsMandatory = 1;
    IsSupervised = 1;
    OrganizationAddress = "1600 Amphitheatre Parkway, n/a, , Mountain VIew, CA 94043";
    OrganizationAddressLine1 = "1600 Amphitheatre Parkway";
    OrganizationAddressLine2 = "n/a";
    OrganizationCity = "Mountain VIew";
    OrganizationCountry = USA;
    OrganizationEmail = "abma@google.com";
    OrganizationName = "Google LLC";
    OrganizationPhone = 12125658743;
    OrganizationZipCode = 94043;
    SkipSetup =     (
        AppleID,
        Siri,
        iCloudDiagnostics
    );
}

Kernel extensions

Get list of approved kernel extensions (e.g. TripMode and Intel Power).

$ echo 'select * from kext_policy; ' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
78UFGP42EU|ch.tripmode.TripModeNKE|1|Ludovic LEGER|1
Z3L495V9L4|com.intel.driver.EnergyDriver|1|Intel Corporation Apps|1
$ echo 'select * from kext_policy_mdm;' | sudo sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy
EQHXZ8M8AV||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
P8DQRXPVLP||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
X9E956P446||1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319
3T5GSNBU6W|com.github.osxfuse.filesystems.osxfuse|1|82CBE2F3-84FA-4734-9E74-FB0F06DB8319

<syntaxhighlight lang="console">$ cat /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>

   <key>CloudConfigProfile</key>
   <dict>
       <key>AllowPairing</key>
       <true/>

...

 </dict>

</dict> </plsit></syntaxhighlight>

Code signing

Get code signing information about an app.

$ codesign -dvv /Applications/ESET\ Endpoint\ Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext
Executable=/Applications/ESET Endpoint Antivirus.app/Contents/PlugIns/kext/esets_kac_64_109.kext/Contents/MacOS/esets_kac_64_109
Identifier=com.eset.kext.esets-kac
Format=bundle with Mach-O thin (x86_64)
CodeDirectory v=20200 size=759 flags=0x0(none) hashes=18+3 location=embedded
Signature size=9055
Authority=Developer ID Application: ESET, spol. s r.o. (P8DQRXPVLP)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=22 Aug 2018 at 19:39:32
Info.plist entries=19
TeamIdentifier=P8DQRXPVLP
Sealed Resources version=2 rules=13 files=1
Internal requirements count=1 size=36

PowerChime

The new MacBook Pro machine chimes when it gets power. Annoying??

Set static route, and make persistent on boot

https://apple.stackexchange.com/questions/219834/how-to-set-network-devices-priority-on-afp-smb-transfers

In the example below I assume the Ethernet router has the IP 192.168.0.1 and the network behind the router is the 192.168.56.0/24 network.

sudo route add -net 192.168.56.0  192.168.0.1

To make this route persistent add a launch daemon on your machines:

sudo nano /Library/LaunchDaemons/local.staticroute.shares.plist

with the content

<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>

   <key>Label</key>
   <string>local.staticroute.shares</string>
   <key>ProgramArguments</key>
   <array>
     <string>route</string>
     <string>add</string>
     <string>-net</string>
     <string>192.168.56.0</string>
     <string>192.168.0.1</string>
   </array>
   <key>RunAtLoad</key>
   <true/>
 </dict>

</plist></syntaxhighlight> Save the file (Ctrl-O) and quit Nano (Ctrl-X).

Load the launch daemon with:

sudo launchctl load -w /Library/LaunchDaemons/local.staticroute.shares.plist

To access the shares enter afp://192.168.56.x, cifs://192.168.56.x or smb://192.168.56.x (with x= the last octet of the IP address of the share).

Open System Preferences as root

<syntaxhighlight lang="shell">sudo /System/Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences</syntaxhighlight>

macOS Big Sur

Change the menu bar date/time format

Update the format using Terminal.

defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm a"

My prefered version of the command. NOTE: spaces aren’t needed.

defaults write com.apple.menuextra.clock DateFormat -string "EMdhhmmss"

System Extensions

Get list of loaded extensions.

$ kmutil showloaded

Get list of loaded auxillary extensions.

$ kmutil showloaded --collection auxiliary

macOS Catalina

Remove “default interactive” warning for bash.

macOS Catalina ships with zsh as the default shell for licensing reasons. To notify users, a warning is presented each time a bash interactive shell is started.

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

To disable the warning, add this to ~/.bash_profile or equivalent.

export BASH_SILENCE_DEPRECATION_WARNING=1