macOS

Last update: February 3, 2023

I'm a macOS user, and I like this operating system because it is based on UNIX and thus has great command line support.

Show hidden files

Shift + Command + .

Special startup modes

Start up in single-user, verbose mode or target mode:

  • Shut down your Mac if it is on.
  • Press the power button to start the computer.
  • Immediately press and hold the one of the following:
    • the Command + s key for single-user mode
    • the Command + v key for verbose mode
    • the t key (no command for this one) for target mode

single user mode is also called root mode

Check encryption status

diskutil cs list | grep Conversion

macOS specific command

say "a sentence"
echo "copy that" | pbcopy # Copy in clipboard from the term
pbpaste # Past from clipboard
mdfind # Find files
tput bel # Make the term beep
hdiutil attach /path/to/diskimage.dmg # mount disk image

Change the time between two time machine saves

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800 # seconds

Brew

The Missing Package Manager for macOS (or Linux)

Brew basic commands:

brew doctor
brew search ***
brew info ***
brew help

A list of brew packages I use

  • ack
  • imagemagick
  • mosh
  • exiftool
  • ffmpeg
  • wget
  • fswatch

Disable IPv6 from the command line

This trick has been important for me as it fix a docker-compose network crash.

If your active network is WiFi enter the following command:
networksetup -setv6off Wi-Fi
If you are on Ethernet:
networksetup -setv6off Ethernet
To re-enable IPv6, you need to replace setv6off to setv6automatic (the default state in macOS), for example:
networksetup -setv6automatic Wi-Fi

List of opinionated App I use or like

  • 1Password
  • Ableton Live
  • Adobe Photoshop
  • Android Studio
  • Backblaze
  • BetterTouchTool
  • Docker
  • Electrum
  • FileZilla
  • Firefox
  • GrandPerspective
  • ImageOptim
  • iStat Menus
  • Jumpcut
  • LibreOffice
  • Max
  • Meld
  • Steam
  • Subtitles
  • The Unarchiver
  • Transmission
  • VirtualBox
  • Visual Studio Code
  • VLC
  • Vysor
  • Xcode
  • Audacity
  • Audio Hijack Pro
  • Gephi
  • OpenEmu
  • Vosyr