Skip to content

Instantly share code, notes, and snippets.

@eddy-22
Created February 16, 2023 22:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddy-22/35f5cd8534a140a4029cf84dc0552669 to your computer and use it in GitHub Desktop.
Save eddy-22/35f5cd8534a140a4029cf84dc0552669 to your computer and use it in GitHub Desktop.
MacOS Cool Stuff

A curated list of useful command line apps, in celebration of the TUI.

“Knowledge brings fear” (Mars University Mission Statement)

Awesome

If you want to contribute, you are highly encouraged to do so. Please read the contribution guidelines.

Women Empowerment in Zanzibar

Send a little karma down the way and support women empowerment in Zanzibar by helping to fund the local production of reusable female hygiene products. A very dear friend of mine runs the project. They were already able to buy hundreds of educational books. Sometimes, it takes so little to make a huge impact. If you'd like to thank me or support this work, donate. Additionally, any current and future sponsoring of my work via GitHub or other channels will flow one hundred percent to the NGO.

Contents

*nix/*nux

Automation

  • Ansible - Automate deployment, configuration, and upgrading.
  • fswatch - Cross-platform file change monitor with multiple backends.
  • rocinante - Lightweight configuration management software for FreeBSD.

Backup

  • Amanda - Open Source Network Backup for Linux, Windows, UNIX and OS X.
  • Attic - Deduplicating backup program written in Python.
  • Bacula - Manage backups, recovery, and verification of computer data across a network of computers of different kinds.
  • BorgBackup - Significantly improved fork of Attic.
  • duply - Easily create GPG encrypted, compressed backups of any data almost anywhere.
  • mysqldump-secure - Secure mysqldump script with encryption, compression, logging, blacklisting and Nagios monitoring integration.
  • Restic - Fast, secure, efficient backup program.

Benchmarking

  • hyperfine - Benchmark commands through the command line.
  • loadtest - Runs a load test on the selected HTTP URL.
  • pv - Monitor the progress of data through a pipeline.
  • siege - HTTP load testing and benchmarking utility.

Cloud Services

  • awless - Mighty command-line interface for Amazon Web Services.
  • awscli - Official Amazon AWS command-line interface.
  • cadaver - WebDAV client for Unix.
  • google-drive-upload - Upload and sync files to Google Drive.

Compression

  • archivemount - FUSE filesystem using libarchive to mount archives.
  • dtrx - Takes all the hassle out of extracting archives.

Content Creation

  • GitBook - Library and cmd utility to generate GitBooks.

Conversion

  • binchunker - Converts a CD image in a ".bin/.cue" format (sometimes ".raw/.cue") to a set of .iso and .cdr tracks.
  • Echo - Convert HTML tables to JSON/CSVs.
  • Pandoc - Universal document converter.

Databases

  • LiteCLI - SQLite client with auto-completion.
  • mycli - Command-line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting.
  • pgcli - Command-line interface for Postgres with auto-completion and syntax highlighting.
  • usql - Universal command-line interface for SQL databases.

Data Processing

  • datamash - Perform basic numeric, textual and statistical operations on textual data files.
  • edcount - Estimate distinct count of values from standard input.
  • hq - Powerful command-line tool for slicing & dicing HTML.
  • jq - Lightweight and flexible JSON processor.
  • Miller - Like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON.
  • tq - Perform a lookup by CSS selector on an HTML input.
  • xq - Like jq, but for XML and XPath.

Developer

  • bat - Go implement CLI, cURL-like tool for humans.
  • bcal - Byte calculator for storage conversions and calculations.
  • bitwise - Interactive bit manipulator in curses.
  • caniuse-cmd - All the power of caniuse.com with none of the GUI.
  • clog - Conventional changelog for the rest of us.
  • Cookiecutter - Creates projects from cookiecutters (project templates).
  • Critical - Extract & inline critical-path CSS in HTML pages.
  • diff-so-fancy - Better, highly readable diffs.
  • git-filter-repo - Quickly rewrite git repository history (filter-branch replacement).
  • grex - Generate regular expressions from user-provided test cases.
  • Grunt - The JavaScript Task Runner.
  • gulp - Automate and enhance your build workflow.
  • how2 - Stack Overflow from the terminal.
  • howdoi - Instant coding answers via the command line.
  • http-prompt - Interactive HTTP client featuring autocomplete and syntax highlighting, built on HTTPie and prompt_toolkit.
  • HTTPie - User-friendly cURL replacement featuring intuitive UI, JSON support, syntax highlighting, wget-like downloads, extensions, etc.
  • penthouse - Critical path CSS generator.
  • Publoy - Command line tool to deploy your static web apps via Dropbox.
  • Rebound - Instantly fetch Stack Overflow results when you get a compiler error.
  • saws - Supercharged AWS command-line interface.
  • shellcheck - Static analysis tool for shell scripts.
  • sift - Fast and powerful open source alternative to grep.
  • tokei - Quickly display statistics about your code like number of files, total lines, comments and blanks, grouped by language.
  • Yarn - Deterministic, secure alternative to npm.

Dotfile Management

  • dotdrop - Save your dotfiles once, deploy them everywhere.
  • homeshick - Git dotfiles synchronizer written in Bash.
  • yadm - Yet Another Dotfiles Manager.

Download Utilities

  • aria2 - Lightweight multi-protocol & multi-source command-line download utility.
  • peerflix - Streaming torrent client for node.js.

Email

  • abook - Text-based address book program designed to use with mutt mail client.
  • aerc - A pretty good email client.
  • Alpine - Fast, easy to use email client.
  • IMAPdedup - IMAP message de-duplicator.
  • imapsync - IMAP synchronisation, sync, copy or migration tool.
  • isync - Synchronize Maildir and IMAP4 mailboxes both ways.
  • Mutt - All mail clients suck, this one just sucks less.
  • Notmuch - Fast, global-search and tag-based email system.
  • OfflineIMAP - Two-way sync your e-mail mailboxes as a local Maildir.
  • piler - Email archiving solution, a viable alternative to commercial products.
  • Sup - Curses threads-with-tags style email client.
  • Terjira - Command line power tool for Jira.

Encryption

  • EncFS - Provides an encrypted filesystem in user-space.
  • GnuPG - Complete and free implementation of the OpenPGP standard as defined by RFC4880 (also known as PGP).

Filesystem Management

  • dust - More intuitive version of 'du'.
  • FDUPES - Identify or delete duplicate files residing within specified directories.
  • Midnight Commander - Feature-rich visual file manager.
  • Ncdu - Disk usage analyzer with an ncurses interface.
  • nnn - Fast, minimal and extensible file manager.
  • ranger - Minimalistic visual file manager featuring curses interface with vi key bindings.
  • vifm - ncurses based file manager with vi like keybindings/modes/options/commands/configuration, which also borrows some useful ideas from mutt.
  • zfsnap - Rolling ZFS snapshots the easy way.

FTP

  • CurlFtpFS - Filesystem for accessing FTP hosts based on FUSE and libcurl.
  • LFTP - Sophisticated ftp/http client, and a file transfer program supporting a number of network protocols.
  • NcFTP - Set of free application programs implementing the File Transfer Protocol (FTP).

Games

  • Angband - Free, single-player dungeon exploration game.
  • Cataclysm: Dark Days Ahead - Roguelike set in a post-apocalyptic world.
  • Curse of War - Fast-paced real-time action strategy game.
  • dopewars - Deal in drugs on the streets of New York, amassing a huge fortune and paying off the loan shark, while avoiding the ever-annoying police.
  • Frotz - Interpreter for Infocom games and other Z-machine games.
  • Nethack - Single player dungeon exploration game that runs on a wide variety of computer systems.
  • vitetris - Tetris clone.

IRC

  • BitlBee - IRC to other chat networks gateway.
  • Irssi - The client of the future.
  • WeeChat - Fast, light and extensible chat client.

Media

  • abcde - A Better CD Encoder.
  • AtomicParsely - Reads, parses and sets metadata into MPEG-4 files.
  • Audiogrep - Creates audio supercuts.
  • Beets - The music geek's media organizer.
  • cmus - Small, fast and powerful console music player for Unix-like operating systems.
  • FFmpeg - Records, converts and streams audio and video.
  • Gifsicle - Creates, edits, and gets information about GIF images and animations.
  • HandBrakeCLI - Converts video from nearly any format to a selection of modern, widely supported codecs.
  • Legofy - Makes images look like they were built out of Lego.
  • MediaInfo - Convenient unified display of the most relevant technical and tag data for video and audio files.
  • MKVToolNix - Set of tools to create, alter and inspect Matroska files under Linux, other Unices and Windows.
  • mopidy - Self-hosted MPD daemon that connects to Spotify and Soundcloud.
  • moviemon - Everything about your movies within the command-line.
  • mp3fs - FUSE-based transcoding filesystem from FLAC to MP3.
  • mp4v2 - Library and tools to provide functions to read, create, and modify mp4 files.
  • mpg123 - Fast console MPEG Audio Player and decoder library.
  • mpv - Free, open source, and cross-platform media player.
  • musikcube - Fully functional terminal-based music player, library, and streaming audio server.
  • ncmpcpp - NCurses based MPD client.
  • OptiPNG - PNG optimizer that recompresses image files to a smaller size, without losing any information.
  • Pngcrush - Optimizer for PNG (Portable Network Graphics) files.
  • Shellpic - Display images inline in the shell, ASCII-art is so 2013.
  • subdownloader - Downloading subtitles for one or more files is just a command away.
  • ttystudio - Terminal-to-gif recorder minus the headaches.
  • Video Transcoding Scripts - Utilities to transcode, inspect and convert videos.
  • Videogrep - Automatic supercuts with Python.
  • youtube-dl - Download videos from YouTube.com and a few more sites.

Miscellaneous

  • ansiweather - Weather in your terminal, with ANSI colors and Unicode symbols.
  • cointop - Interactive cryptocurrency tracking.
  • FIGlet - Program for making large letters out of ordinary text.
  • license - Create LICENSEs from the command-line.
  • pockyt - Composable Pocket client for the terminal.
  • wego - Weather client for the terminal.
  • wttr.in - Console-based weather forecasts.

Networking

  • bandwhich - Displays current network utilization by process, connection and remote IP or hostname.
  • Bandwidth Monitor NG - Small and simple live network and disk IO bandwidth monitor.
  • Blucat - netcat for Bluetooth.
  • gping - Ping, but with a graph.
  • httping - Like 'ping' but for http requests.
  • iftop - Display bandwidth usage on an interface.
  • ipdb - Tools for IP based Geo-blocking and Geo-routing.
  • localtunnel - Exposes your localhost to the world for easy testing and sharing.
  • mtr - Combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool.
  • Netcat - Networking utility which reads and writes data across network connections, using the TCP/IP protocol.
  • Nethogs - Linux 'net top' tool.
  • ngrep - grep as a network packet analyzer.
  • nmap - Network discovery and security auditing utility.
  • vnStat - Console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s).

Presentation

  • termui - Cross-platform, easy-to-compile, and fully-customizable terminal dashboard.
  • WOPR - Simple markup language for creating rich terminal reports, presentations and infographics.

Productivity

  • doing - Keeping track of what you’re doing and tracking what you’ve done.
  • idea - Lightweight CLI tool and module for keeping ideas in a safe place quick and easy.
  • ledger - Powerful, double-entry accounting system that is accessed from the UNIX command-line.
  • MapSCII - OpenStreetMap client, renders an explorable Braille & ASCII world map.
  • pdfgrep - Command-line utility to search text in PDF files.
  • pin-cushion - Simple, maintained command-line interface to the Pinboard.in API.
  • Remind - Sophisticated calendar and alarm program.
  • SC-IM - ncurses-based spreadsheet application.
  • Taskwarrior - Manage your Todo list.
  • Timetrap - Simple timetracker.
  • Watson - Elegant time tracking.
  • woof - Simple one-off HTTP file sharing.

RSS

  • newsbeuter - The Mutt of RSS feed readers.
  • rss2email - Get news from RSS feeds in email.
  • rsstail - Monitors a single RSS feed and emits only new entries.

Searching

  • fd - fd is a simple, fast and user-friendly alternative to 'find'.
  • fselect - 'find' replacement with SQL-like syntax.
  • fzf - A general-purpose fuzzy finder.
  • ripgrep - Recursively search directories for a regex pattern extremely fast.
  • sd - Intuitive find-and-replace alternative to 'sed'.
  • The Silver Searcher - Blazingly fast tool for searching code.

Security

  • acme.sh - Pure Unix shell script implementing ACME client protocol, for Let's Encrypt.
  • Aircrack-ng - 802.11 WEP and WPA-PSK keys cracking program that can recover keys once enough data packets have been captured.
  • Let's Encrypt - Free, automated and open Certificate Authority.
  • pass - The standard Unix password manager.

Shells

  • fish - Finally, a command line shell for the 90s.
  • Fisher - Package manager for the fish shell.
  • oksh - Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).

SSH

  • autossh - Automatically restart SSH sessions and tunnels.
  • sshfs - Locally mount a remote folder via SSH.
  • storm - Manage your SSH connections.

System

  • ApacheTop - Curses-based top-like display for Apache information, including requests per second, bytes per second, most popular URLs, etc.
  • bottom - Graphical process/system monitor with a customizable interface and multitude of features.
  • bpytop - Resource monitor that shows usage and stats for processor, memory, disks, network and processes.
  • doas - A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos.
  • dstat - Versatile replacement for vmstat, iostat, netstat and ifstat.
  • htop - Interactive process viewer.
  • iotop - Find out what's stressing and increasing load on your hard disks.
  • maybe - See what a program does before deciding whether you really want it to happen.
  • neofetch - Fast, highly customizable system info script.
  • netboot.xyz - Boot multiple Operating System installers or utilities over the network from a single menu.
  • procs - Modern replacement for 'ps'.
  • screenFetch - Fetches system/theme information in terminal for desktop screenshots.

Terminal

  • angle-grinder - Slice and dice logs, allows to parse, aggregate, sum, average, min/max, percentile, and sort data.
  • asciinema - Record terminal sessions and share them on the web.
  • autojump - 'cd' command that learns - easily navigate directories from the command line.
  • bat - 'cat' clone with syntax highlighting and Git integration.
  • bgrep - Like grep but for binary strings.
  • byobu - Text-based window manager and terminal multiplexer.
  • ccat - Colorizing the 'cat' command.
  • cheat - Create and view interactive cheatsheets.
  • desk - Lightweight workspace manager for the shell.
  • dit - Dotfile manager that hooks into Git.
  • entr - Run arbitrary commands when files change.
  • exa - Modern version of 'ls'.
  • fundle - Minimalist package manager for dish shell.
  • LNAV - Advanced log file viewer for the small-scale that understands your log files.
  • Marker - The terminal command palette.
  • mtm - Perhaps the smallest useful terminal multiplexer in the world.
  • MultiTail - Monitor logfiles and command output in multiple windows in a terminal, colorize, filter and merge.
  • PathPicker - After parsing the output from a command, PathPicker presents you with a nice UI to select which files you're interested in.
  • pick - Fuzzy select anything.
  • SCREEN - "Window manager" for the console and terminals.
  • Starship - Minimal, blazing-fast and infinitely customizable prompt for any shell.
  • tealdeer - Very fast implementation of 'tldr'.
  • tmux - Terminal multiplexer.
  • yank - Yank terminal output to clipboard.
  • z - Tracks your most used directories, based on "frecency".
  • zoxide - Similar to 'z' but a standalone binary, therefore shell-independent.

Text Editors

  • Diakonos - Linux editor for the masses.
  • Emacs - Extensible, customizable text editor.
  • Kakoune - Modal editor with multiple selections and orthogonal design.
  • Micro - Modern and intuitive text editor.
  • Neovim - Modern version of the Vim editor with many advanced features.
  • Vim - Advanced text editor that seeks to provide the power of the de-facto Unix editor 'Vi', with a more complete feature set.
  • Vis - Highly efficient text editor.

Version Control

  • Bazaar - Easily manage source code on Windows, Ubuntu, GNU/Linux, and Mac OS X.
  • fossil - Simple, high-reliability, distributed SCM with integrated bug tracking, wiki, forum, and technotes.
  • Git - Git is a free and open source distributed version control system.
  • gitfs - Version controlled file system.
  • grv - ncurses based text-mode Git repository browser.
  • Mercurial - Free, distributed source control management tool.
  • tig - ncurses based text-mode interface for Git.

VPN

  • OpenVPN - Full-featured open source SSL VPN solution.
  • racoon - Internet Key Exchange (IKE) daemon for automatically keying IPsec connections.
  • strongSwan - Open Source IPsec for Linux.

World Wide Web

  • browsh - A fully interactive, real-time and modern browser rendered to TTY.
  • ELinks - Advanced and well-established feature-rich text mode web (HTTP/FTP/..) browser.
  • GoAccess - Real-time visual web log analyzer and interactive viewer.
  • googler - Google Search, Google Site Search, Google News from the terminal.
  • pageres - Capture screenshots of websites in various resolutions.

BSD

  • ezjail - Jail administration framework.
  • iocage - Convenient, lightweight & easy container management for BSD jails.
  • pkgsrc - Portable package build system.
  • poudriere - Port/package build and test system.

Linux

  • aptly - Swiss army knife for Debian repository management.
  • btrfs - Copy-on-write file system for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration.
  • deborphan - Finds packages installed on your Debian system that have no other packages depending on them.
  • IPTraf - Network statistics utility for Linux.

macOS

  • Fink - The full world of Unix Open Source software for Darwin.
  • Homebrew - The missing package manager for OS X.
  • itunes-remote - Control iTunes via CLI.
  • MacPorts - Compile, install and upgrade either command-line, X11 or Aqua based open-source software.
  • mas - Mac App Store command line interface.
  • Night Shift Shell Utility - Simple shell utility to control the macOS Night Shift feature.
  • reminders-cli - Simple interface for interacting with Reminders.
  • tag - Manipulate tags on files and query for files with those tags.
  • XLD - Tool to decode/convert/play various lossless audio files.

Helpers

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Awesome macOS Command Line

A curated list of shell commands and tools specific to macOS.

“You don’t have to know everything. You simply need to know where to find it when necessary.” (John Brunner)

Awesome

If you want to contribute, you are highly encouraged to do so. Please read the contribution guidelines.

For more terminal shell goodness, please also see this list's sister list Awesome Command Line Apps.

A Personal Note

Not all information contained in this list is always up-to-date with the latest OS releases. Apple does support devices for an extended time frame but they're also costly to purchase. Currently, I don't have the ability to replace my Mid-2014 15" MacBook Pro and it doesn't run Monterey or above. On one hand, the fact that this machine is still running mostly intact is a testament to its hardware and build quality. On the other, the fact that my older OS release will very soon not receive any security updates and bug fixes is a bit unsettling. And well, it directly affects my ability to provide timely updates.

So maybe someone from Apple reads this and can do something about that situation.

Furthermore, looking at almost 26k GitHub stars for this repository, if only about 14% of the people who this resource is useful for, sponsored me with a one time amount of a single Euro, I could order a new machine that probably lasted me another eight years. It's not something I'd expect, nor think I should. It's entirely my issue. Still, something to think about.

On top of everything, I'm currently out of a job, have little prospects, am very short on money and am going through a tough time. To help me out, the easiest way is to sponsor me via GitHub, either recurring or as a one-time donation. Every little bit helps. Thank you for considering it.

https://github.com/herrbischoff

Contributing

You are very welcome to send me patches for changes and additions via email. If you are unfamiliar with the git am workflow, you can find an easy introduction to it here: https://git-send-email.io

Foreword

There's really only one thing I'd like to note here: man pages. Man pages. Man pages. Okay, three things. But this one thing seemed so important, I had to mention it multiple times. If you're not doing it already, you should get into the habit of consulting man pages before searching anywhere else. Unix-style man pages are an excellent source of documentation. There's even a man page for the man command itself:

man man

It also explains what the numbers in the man pages refer to --- like man(1).

Contents

Appearance

Alert Dialog Style

Switch to Legacy Horizontal Layout

# Enable
defaults write -g NSAlertMetricsGatheringEnabled -bool false

# Disable (Default)
defaults delete -g NSAlertMetricsGatheringEnabled

Dark Mode

Exclude App From Dark Mode

This is useful for older applications that run properly but haven't been updated to work properly with dark mode. Change app name Notes to the actual application you want to target.

# Enable
defaults write $(osascript -e 'id of app "Notes"') NSRequiresAquaSystemAppearance -bool true

# Disable (Default)
defaults delete $(osascript -e 'id of app "Notes"') NSRequiresAquaSystemAppearance

Proxy Icon

Always Show Window Proxy Icons

In macOS 11 (Big Sur), the document proxy icon was hidden by default. This restores the former always-visible state.

# Enable
defaults write -g NSToolbarTitleViewRolloverDelay -float 0

# Disable (Default)
defaults delete -g NSToolbarTitleViewRolloverDelay

Alternatively, you can set an accessibility flag.

# Enable
defaults write com.apple.universalaccess showWindowTitlebarIcons -bool true

# Disable (Default)
defaults write com.apple.universalaccess showWindowTitlebarIcons -bool true

Subpixel Anti-Aliasing (Font Smoothing)

Setting present since macOS 10.14 (Mojave).

# Enable
defaults write -g CGFontRenderingFontSmoothingDisabled -bool false

# Disable (Default)
defaults write -g CGFontRenderingFontSmoothingDisabled -bool true

# Per Application
defaults write com.apple.textedit CGFontRenderingFontSmoothingDisabled -bool false

# Revert for Application
defaults delete com.apple.textedit CGFontRenderingFontSmoothingDisabled

Transparency

Transparency in Menu and Windows

# Reduce Transparency
defaults write com.apple.universalaccess reduceTransparency -bool true

# Restore Default Transparency
defaults write com.apple.universalaccess reduceTransparency -bool false

Wallpaper

Set Wallpaper

# Up to OS X 10.8 (Mountain Lion)
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/path/to/picture.jpg"'

# Since OS X 10.9 (Mavericks)
sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '/path/to/picture.jpg'" && killall Dock

Applications

App Store

List All Apps Downloaded from App Store

# Via find
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##'

# Via Spotlight
mdfind kMDItemAppStoreHasReceipt=1

Show Debug Menu

Works up to OS X 10.10 (Yosemite).

# Enable
defaults write com.apple.appstore ShowDebugMenu -bool true

# Disable (Default)
defaults write com.apple.appstore ShowDebugMenu -bool false

Apple Remote Desktop

Kickstart Manual Pages

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help

Activate And Deactivate the ARD Agent and Helper

# Activate And Restart the ARD Agent and Helper
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -restart -agent -console

# Deactivate and Stop the Remote Management Service
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop

Remote Desktop Sharing

# Allow Access for All Users and Give All Users Full Access
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all

# Disable ARD Agent and Remove Access Privileges for All Users (Default)
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

Remove Apple Remote Desktop Settings

sudo rm -rf /var/db/RemoteManagement ; \
sudo defaults delete /Library/Preferences/com.apple.RemoteDesktop.plist ; \
defaults delete ~/Library/Preferences/com.apple.RemoteDesktop.plist ; \
sudo rm -r /Library/Application\ Support/Apple/Remote\ Desktop/ ; \
rm -r ~/Library/Application\ Support/Remote\ Desktop/ ; \
rm -r ~/Library/Containers/com.apple.RemoteDesktop

Contacts

Debug Mode

# Enable
defaults write com.apple.addressbook ABShowDebugMenu -bool true

# Disable (Default)
defaults write com.apple.addressbook ABShowDebugMenu -bool false

Google

Uninstall Google Update

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/ksinstall --nuke

iTunes

Keyboard Media Keys

Works up to OS X 10.10 (Yosemite). System Integrity Protection was introduced in OS X 10.11 (El Capitan) which prevents system Launch Agents from being unloaded.

# Stop Responding to Key Presses
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist

# Respond to Key Presses (Default)
launchctl load -w /System/Library/LaunchAgents/com.apple.rcd.plist

From OS X 10.11 (El Capitan) on, you can either disable SIP or resort to a kind of hack, which will make iTunes inaccessible to any user, effectively preventing it from starting itself or its helpers. Be aware that for all intents and purposes this will trash your iTunes installation and may conflict with OS updates down the road.

sudo chmod 0000 /Applications/iTunes.app

Mail

Show Attachments as Icons

defaults write com.apple.mail DisableInlineAttachmentViewing -bool true

Vacuum Mail Index

The AppleScript code below will quit Mail, vacuum the SQLite index, then re-open Mail. On a large email database that hasn't been optimized for a while, this can provide significant improvements in responsiveness and speed.

(*
Speed up Mail.app by vacuuming the Envelope Index
Code from: http://web.archive.org/web/20071008123746/http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
Originally by "pmbuko" with modifications by Romulo
Updated by Brett Terpstra 2012
Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compatibility
Updated by Andrei Miclaus 2017 to support V4 in Sierra
*)

tell application "Mail" to quit
set os_version to do shell script "sw_vers -productVersion"
set mail_version to "V2"
considering numeric strings
    if "10.10" <= os_version then set mail_version to "V3"
    if "10.12" <= os_version then set mail_version to "V4"
    if "10.13" <= os_version then set mail_version to "V5"
    if "10.14" <= os_version then set mail_version to "V6"
    if "10.15" <= os_version then set mail_version to "V7"
    if "11" <= os_version then set mail_version to "V8"
end considering

set sizeBefore to do shell script "ls -lnah ~/Library/Mail/" & mail_version & "/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
do shell script "/usr/bin/sqlite3 ~/Library/Mail/" & mail_version & "/MailData/Envelope\\ Index vacuum"

set sizeAfter to do shell script "ls -lnah ~/Library/Mail/" & mail_version & "/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"

display dialog ("Mail index before: " & sizeBefore & return & "Mail index after: " & sizeAfter & return & return & "Enjoy the new speed!")

tell application "Mail" to activate

Since the above AppleScript mainly uses shell commands anyway, here's a shell script version of the same functionality. It's usable from Big Sur onwards. Feel free to send a patch for newer systems. I currently don't have the money for a machine capable of running macOS 12+.

#!/bin/zsh

#
# Speed up Mail.app by vacuuming the Envelope Index
# Written by Marcel Bischoff
# AppleScript original by "pmbuko" with modifications by Romulo
#

OS_VERSION=$(sw_vers -productVersion | cut -d. -f 1,2)
MAIL_RUNNING=$(ps aux | grep -v grep | grep -c "Mail\$")
MAIL_VERSION="V2"

if [ $MAIL_RUNNING -gt 0 ]; then osascript -e 'tell application "Mail" to quit'; fi

if [ 1 -eq "$(echo "11 <= ${OS_VERSION}" | bc)" ]; then MAIL_VERSION="V8"; fi

SIZE_BEFORE=$(ls -lnah ~/Library/Mail/${MAIL_VERSION}/MailData | grep -E 'Envelope Index$' | awk {'print $5'})
/usr/bin/sqlite3 ~/Library/Mail/${MAIL_VERSION}/MailData/Envelope\ Index vacuum
SIZE_AFTER=$(ls -lnah ~/Library/Mail/${MAIL_VERSION}/MailData | grep -E 'Envelope Index$' | awk {'print $5'})

printf "Mail index before: %s\nMail index after: %s\n" $SIZE_BEFORE $SIZE_AFTER

Safari

Change Default Fonts

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2StandardFontFamily Georgia
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFontSize 16
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2FixedFontFamily Menlo
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFixedFontSize 14

Develop Menu and Web Inspector

# Enable
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true && \
defaults write com.apple.Safari IncludeDevelopMenu -bool true && \
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true && \
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true && \
defaults write -g WebKitDeveloperExtras -bool true

# Disable (Default)
defaults delete com.apple.Safari IncludeInternalDebugMenu && \
defaults delete com.apple.Safari IncludeDevelopMenu && \
defaults delete com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey && \
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled && \
defaults delete -g WebKitDeveloperExtras

Get Current Page Data

Other options: get source, get text.

osascript -e 'tell application "Safari" to get URL of current tab of front window'

Use Backspace/Delete to Go Back a Page

# Enable
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true

# Disable (Default)
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool false

Sketch

Export Compact SVGs

defaults write com.bohemiancoding.sketch3 exportCompactSVG -bool true

Skim

Turn Off Auto Reload Dialog

Removes the dialog and defaults to auto reload.

defaults write -app Skim SKAutoReloadFileUpdate -boolean true

Terminal

Focus Follows Mouse

# Enable
defaults write com.apple.Terminal FocusFollowsMouse -string true

# Disable (Default)
defaults write com.apple.Terminal FocusFollowsMouse -string false

TextEdit

Create an Untitled Document at Launch

defaults write com.apple.TextEdit NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool false

Use Plain Text Mode as Default

defaults write com.apple.TextEdit RichText -int 0

Visual Studio Code

VSCodeVim Key Repeat

# Enable
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

# Disable (Default)
defaults delete com.microsoft.VSCode ApplePressAndHoldEnabled

Subpixel Anti-Aliasing

Setting present since macOS 10.14 (Mojave). See also system-wide setting: Subpixel Anti-Aliasing

# Enable
defaults write com.microsoft.VSCode CGFontRenderingFontSmoothingDisabled -bool false && \
defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled -bool false && \
defaults write com.microsoft.VSCode.helper.EH CGFontRenderingFontSmoothingDisabled -bool false && \
defaults write com.microsoft.VSCode.helper.NP CGFontRenderingFontSmoothingDisabled -bool false

# Disable (Default)
defaults delete com.microsoft.VSCode CGFontRenderingFontSmoothingDisabled && \
defaults delete com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled && \
defaults delete com.microsoft.VSCode.helper.EH CGFontRenderingFontSmoothingDisabled && \
defaults delete com.microsoft.VSCode.helper.NP CGFontRenderingFontSmoothingDisabled

Backup

Time Machine

Activation

# Enable
sudo tmutil enable

# Disable
sudo tmutil disable

# Start backup immediately
tmutil startbackup

# Stop backup immediately
tmutil stopbackup

Change Backup Interval

This changes the interval to 30 minutes. The integer value is the time in seconds.

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

Exclude Files

sudo tmutil addexclusion /path/to/file/or/folder

Local Backups

Whether Time Machine performs local backups while the Time Machine backup volume is not available.

# Status
defaults read /Library/Preferences/com.apple.TimeMachine MobileBackups

# Enable (Default)
sudo tmutil enablelocal

# Disable
sudo tmutil disablelocal

Since macOS 10.13 (High Sierra), you cannot disable local snapshots. Time Machine now always creates a local APFS snapshot and uses that snapshot as the data source to create a regular backup, rather than using the live disk as the source, as is the case with HFS formatted disks.

Manage Backup Volumes

# Info
tmutil destinationinfo

# Remove current destination
tmutil removedestination

# Set physical disk destination
tmutil setdestination /path/to/volume/or/volume/name

# Set network destination
tmutil setdestination -p smb://10.20.30.40/share

Prevent Time Machine from Prompting to Use New Hard Drives as Backup Volume

sudo defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

Show Time Machine Logs

This little script will output the last 12 hours of Time Machine activity followed by live activity.

#!/bin/sh

filter='processImagePath contains "backupd" and subsystem beginswith "com.apple.TimeMachine"'

# show the last 12 hours
start="$(date -j -v-12H +'%Y-%m-%d %H:%M:%S')"

echo ""
echo "[History (from $start)]"
echo ""

log show --style syslog --info --start "$start" --predicate "$filter"

echo ""
echo "[Following]"
echo ""

log stream --style syslog --info --predicate "$filter"

Toggle Backup While on Battery

# Status
sudo defaults read /Library/Preferences/com.apple.TimeMachine RequiresACPower

# Enable (Default)
sudo defaults write /Library/Preferences/com.apple.TimeMachine RequiresACPower -bool true

# Disable
sudo defaults write /Library/Preferences/com.apple.TimeMachine RequiresACPower -bool false

Time Machine Statistics

# List all backups
tmutil listbackups

# Show differences
tmutil calculatedrift /path/to/backup/folder/plus/machine/name/folder

Verify Backup

Beginning in OS X 10.11, Time Machine records checksums of files copied into snapshots. Checksums are not retroactively computed for files that were copied by earlier releases of OS X.

sudo tmutil verifychecksums /path/to/backup

Developer

Vim

Compile Sane Vim

Compiling MacVim via Homebrew with all bells and whistles, including overriding system Vim.

brew install macvim --HEAD

Neovim

Install the modern Vim drop-in alternative via Homebrew.

brew install neovim

Xcode

Install Command Line Tools without Xcode

xcode-select --install

Remove All Unavailable Simulators

xcrun simctl delete unavailable

Dock

Add a Stack with Recent Applications

Obsolete since macOS 10.14 (Mojave). See Show Recent Apps.

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' && \
killall Dock

Add a Nameless Stack Folder and Small Spacer

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = {}; "tile-type"="small-spacer-tile"; }' && \
killall Dock

Add a Space

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' && \
killall Dock

Add a Small Space

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}' && \
killall Dock

Auto Rearrange Spaces Based on Most Recent Use

# Enable (Default)
defaults write com.apple.dock mru-spaces -bool true && \
killall Dock

# Disable
defaults write com.apple.dock mru-spaces -bool false && \
killall Dock

Automatically Hide

# Enable
defaults write com.apple.dock autohide -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.dock autohide -bool false && \
killall Dock

Icon Bounce

Global setting whether Dock icons should bounce when the respective application demands your attention.

# Enable (Default)
defaults write com.apple.dock no-bouncing -bool true && \
killall Dock

# Disable
defaults write com.apple.dock no-bouncing -bool false && \
killall Dock

Lock the Dock Size

# Enable
defaults write com.apple.Dock size-immutable -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.Dock size-immutable -bool false && \
killall Dock

Reset Dock

defaults delete com.apple.dock && \
killall Dock

Resize

Fully resize your Dock's body. To resize change the 0 value as an integer.

defaults write com.apple.dock tilesize -int 0 && \
killall Dock

Scroll Gestures

Use your touchpad or mouse scroll wheel to interact with Dock items. Allows you to use an upward scrolling gesture to open stacks. Using the same gesture on applications that are running invokes Exposé/Mission Control.

# Enable
defaults write com.apple.dock scroll-to-open -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.dock scroll-to-open -bool false && \
killall Dock

Set Auto Show/Hide Delay

The float number defines the show/hide delay in ms.

# Hair Trigger Setting
defaults write com.apple.dock autohide-time-modifier -float 0.4 && \
defaults write com.apple.dock autohide-delay -float 0 && \
killall Dock

# Restore Default
defaults delete com.apple.dock autohide-time-modifier && \
defaults delete com.apple.dock autohide-delay && \
killall Dock

Show Hidden App Icons

# Enable
defaults write com.apple.dock showhidden -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.dock showhidden -bool false && \
killall Dock

Show Only Active Applications

# Enable
defaults write com.apple.dock static-only -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.dock static-only -bool false && \
killall Dock

Show Recent Apps

Setting present since macOS 10.14 (Mojave).

# Disable
defaults write com.apple.dock show-recents -bool false  && \
killall Dock

# Enable (Default)
defaults write com.apple.dock show-recents -bool true && \
killall Dock

Single App Mode

When clicking an application icon in the Dock, the respective windows will come to the front, but all other application windows will be hidden.

# Enable
defaults write com.apple.dock single-app -bool true && \
killall Dock

# Disable (Default)
defaults write com.apple.dock single-app -bool false && \
killall Dock

Documents

Convert File to HTML

Supported formats are plain text, rich text (rtf) and Microsoft Word (doc/docx).

textutil -convert html file.ext

Files, Disks and Volumes

Create an Empty File

Creates an empty 10 gigabyte test file.

mkfile 10g /path/to/file

Disable Sudden Motion Sensor

Leaving this turned on is useless when you're using SSDs.

sudo pmset -a sms 0

Eject All Mountable Volumes

The only reliable way to do this is by sending an AppleScript command to Finder.

osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)'

Repair File Permissions

You don't have to use the Disk Utility GUI for this.

sudo diskutil repairPermissions /

Beginning with OS X 10.11 (El Capitan), system file permissions are automatically protected. It's no longer necessary to verify or repair permissions with Disk Utility. (Source)

Set Boot Volume

# Up to OS X 10.10 (Yosemite)
bless --mount "/path/to/mounted/volume" --setBoot

# From OS X 10.11 (El Capitan)
sudo systemsetup -setstartupdisk /System/Library/CoreServices

Show All Attached Disks and Partitions

diskutil list

View File System Usage

A continuous stream of file system access info.

sudo fs_usage

APFS

Present since macOS 10.13 (High Sierra). There is no central utility and usage is inconsistent as most functionality is rolled into tmutil.

Convert Volume from HFS+ to APFS

/System/Library/Filesystems/apfs.fs/Contents/Resources/hfs_convert /path/to/file/system

Create New APFS Filesystem

/System/Library/Filesystems/apfs.fs/Contents/Resources/newfs_apfs /path/to/device

Create Snapshot

tmutil localsnapshot

Delete Snapshot

tmutil deletelocalsnapshots com.apple.TimeMachine.2018-01-26-044042

List Snapshots

tmutil listlocalsnapshots /

Mount Snapshot

Snapshots are read-only.

mkdir ~/mnt
/System/Library/Filesystems/apfs.fs/Contents/Resources/mount_apfs -s com.apple.TimeMachine.2018-01-26-044042 / ~/mnt

Disk Images

Create Disk Image From Folder Contents

hdiutil create -volname "Volume Name" -srcfolder /path/to/folder -ov diskimage.dmg

If you'd like to encrypt the disk image:

hdiutil create -encryption -stdinpass -volname "Volume Name" -srcfolder /path/to/folder -ov encrypted.dmg

By default, you'll be prompted for a password. You can automate that by piping in a password:

echo -n YourPassword | hdiutil create -encryption -stdinpass -volname "Volume Name" -srcfolder /path/to/folder -ov encrypted.dmg

Burn Disk Images to DVD

This command applies to .iso, .img and .dmg images.

hdiutil burn /path/to/image_file

Create Temporary High-Performance Disk

The disk is backed by physical RAM and will be several times faster than an SSD. The contents of the disk cannot be recovered after it has been ejected. The example below is for a 500 MiB RAM disk, adjust as needed.

# Up to macOS 10.14 (Mojave)
let DISKSIZE=500*2048 && \
diskutil erasevolume HFS+ "RAM Disk" `hdiutil attach -nomount ram://$DISKSIZE`

# From macOS 10.15 (Catalina) on
let "DISKSIZE = 500*2048" && \
diskutil erasevolume HFS+ "RAM Disk" `hdiutil attach -nomount ram://$DISKSIZE`

Disable Disk Image Verification

defaults write com.apple.frameworks.diskimages skip-verify -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

Make Volume OS X Bootable

bless --folder "/path/to/mounted/volume/System/Library/CoreServices" --bootinfo --bootefi

Mount Disk Image

hdiutil attach /path/to/diskimage.dmg

Unmount Disk Image

hdiutil detach /dev/disk2s1

Write Disk Image to Volume

Like the Disk Utility "Restore" function.

sudo asr -restore -noverify -source /path/to/diskimage.dmg -target /Volumes/VolumeToRestoreTo

Finder

Desktop

Show External Media

External HDs, thumb drives, etc.

# Enable
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
killall Finder

# Disable (Default)
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false && \
killall Finder

Show Internal Media

Built-in HDs or SSDs.

# Enable
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true && \
killall Finder

# Disable (Default)
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false && \
killall Finder

Show Removable Media

CDs, DVDs, iPods, etc.

# Enable
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true && \
killall Finder

# Disable (Default)
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false && \
killall Finder

Show Network Volumes

AFP, SMB, NFS, WebDAV, etc.

# Enable
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
killall Finder

# Disable (Default)
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false && \
killall Finder

Files and Folders

Clear All ACLs

sudo chmod -RN /path/to/folder

Increase Number of Recent Places

defaults write -g NSNavRecentPlacesLimit -int 10 && \
killall Finder

Show All File Extensions

defaults write -g AppleShowAllExtensions -bool true

Set Protected Flag

This is equivalent to Finder "Locked" status.

# Disable (Default)
sudo chflags -R nouchg /path/to/file/or/folder

# Enable
sudo chflags -R uchg /path/to/file/or/folder

Show Hidden Files

# Show All
defaults write com.apple.finder AppleShowAllFiles true

# Restore Default File Visibility
defaults write com.apple.finder AppleShowAllFiles false

Show Full Path in Finder Title

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

Toggle Folder Visibility in Finder

By default, the ~/Library folder is hidden. You can easily show it again. The same method works with all other folders.

# Hidden (Default)
chflags hidden ~/Library

# Visible
chflags nohidden ~/Library

Layout

Show "Quit Finder" Menu Item

Makes possible to see Finder menu item "Quit Finder" with default shortcut Cmd + Q

# Enable
defaults write com.apple.finder QuitMenuItem -bool true && \
killall Finder

# Disable (Default)
defaults write com.apple.finder QuitMenuItem -bool false && \
killall Finder

Smooth Scrolling

Useful if you’re on an older Mac that messes up the animation.

# Disable
defaults write -g NSScrollAnimationEnabled -bool false

# Enable (Default)
defaults write -g NSScrollAnimationEnabled -bool true

Rubberband Scrolling

# Disable
defaults write -g NSScrollViewRubberbanding -bool false

# Enable (Default)
defaults write -g NSScrollViewRubberbanding -bool true

Expand Save Panel by Default

defaults write -g NSNavPanelExpandedStateForSaveMode -bool true && \
defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true

Desktop Icon Visibility

# Hide Icons
defaults write com.apple.finder CreateDesktop -bool false && \
killall Finder

# Show Icons (Default)
defaults write com.apple.finder CreateDesktop -bool true && \
killall Finder

Path Bar

# Show
defaults write com.apple.finder ShowPathbar -bool true

# Hide (Default)
defaults write com.apple.finder ShowPathbar -bool false

Scrollbar Visibility

Possible values: WhenScrolling, Automatic and Always.

defaults write -g AppleShowScrollBars -string "Always"

Status Bar

# Show
defaults write com.apple.finder ShowStatusBar -bool true

# Hide (Default)
defaults write com.apple.finder ShowStatusBar -bool false

Save to Disk by Default

Sets default save target to be a local disk, not iCloud.

defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false

Set Current Folder as Default Search Scope

defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

Set Default Finder Location to Home Folder

defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"

Set Sidebar Icon Size

Sets size to 'medium'.

defaults write -g NSTableViewDefaultSizeMode -int 2

Metadata Files

Disable Creation of Metadata Files on Network Volumes

Avoids creation of .DS_Store and AppleDouble files.

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

Disable Creation of Metadata Files on USB Volumes

Avoids creation of .DS_Store and AppleDouble files.

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

Opening Things

Change Working Directory to Finder Path

If multiple windows are open, it chooses the top-most one.

cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')"

Open URL

open https://herrbischoff.com

Open File

open README.md

Open Applications

You can open applications using -a.

open -a "Google Chrome" https://herrbischoff.com

Open Folder

open /path/to/folder/

Open Current Folder

open .

Fonts

Clear Font Cache for Current User

To clear font caches for all users, put sudo in front of these commands.

atsutil databases -removeUser && \
atsutil server -shutdown && \
atsutil server -ping

Get SF Mono Fonts

Starting in macOS 10.15 (Catalina), the Utilities apps (including Terminal.app) are now found in the /System folder.

cp -v /Applications/Xcode-beta.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Fonts/SFMono-* ~/Library/Fonts

From macOS 10.12 (Sierra) on, they are included in Terminal.app.

cp -v /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-* ~/Library/Fonts

In older OS versions, you need to download and install Xcode 8 beta for this to work. Afterwards they should be available in all applications.

cp -v /System/Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-* ~/Library/Fonts

Functions

Please see this file.

Hardware

Bluetooth

Up to OS X 10.12 (Sierra) the Bluetooth daemon is named blued instead of bluetoothd. You need to adjust the killall command accordingly.

# Status
defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState

# Enable (Default)
sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 1

# Disable
sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && \
sudo killall -HUP bluetoothd

Harddisks

Force Trim

Enable Trim for non-Apple SSDs. This command is present since OS X 10.10 (Yosemite).

trimforce

Hardware Information

List All Hardware Ports

networksetup -listallhardwareports

Remaining Battery Percentage

pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';'

Remaining Battery Time

pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f3 -d';'

Show Connected Device's UDID

system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p'

Show Current Screen Resolution

system_profiler SPDisplaysDataType | grep Resolution

Show CPU Brand String

sysctl -n machdep.cpu.brand_string

Infrared Receiver

# Status
defaults read /Library/Preferences/com.apple.driver.AppleIRController DeviceEnabled

# Enable (Default)
defaults write /Library/Preferences/com.apple.driver.AppleIRController DeviceEnabled -int 1

# Disable
defaults write /Library/Preferences/com.apple.driver.AppleIRController DeviceEnabled -int 0

Power Management

Prevent System Sleep

Prevent sleep for 1 hour:

caffeinate -u -t 3600

Show All Power Management Settings

sudo pmset -g

Put Display to Sleep after 15 Minutes of Inactivity

sudo pmset displaysleep 15

Put Computer to Sleep after 30 Minutes of Inactivity

sudo pmset sleep 30

Check System Sleep Idle Time

sudo systemsetup -getcomputersleep

Set System Sleep Idle Time to 60 Minutes

sudo systemsetup -setcomputersleep 60

Turn Off System Sleep Completely

sudo systemsetup -setcomputersleep Never

Automatic Restart on System Freeze

sudo systemsetup -setrestartfreeze on

Chime When Charging

Play iOS charging sound when MagSafe is connected.

## Up to macOS 10.12 (Sierra)

# Enable
defaults write com.apple.PowerChime ChimeOnAllHardware -bool true && \
open /System/Library/CoreServices/PowerChime.app

# Disable (Default)
defaults write com.apple.PowerChime ChimeOnAllHardware -bool false && \
killall PowerChime
## From macOS 10.13 (High Sierra) on

# Enable (Default)
defaults write com.apple.PowerChime ChimeOnNoHardware -bool false && \
open /System/Library/CoreServices/PowerChime.app

# Disable
defaults write com.apple.PowerChime ChimeOnNoHardware -bool true && \
killall PowerChime

Input Devices

Keyboard

Auto-Correct

# Disable
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false

# Enable (Default)
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool true

# Show Status
defaults read -g NSAutomaticSpellingCorrectionEnabled

Full Keyboard Access

Enable Tab in modal dialogs.

# Text boxes and lists only (Default)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 0

# All controls
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

Key Repeat

Change the "press and hold" behavior.

# Disable
defaults write -g ApplePressAndHoldEnabled -bool false

# Enable (Default)
defaults write -g ApplePressAndHoldEnabled -bool true

Key Repeat Rate

Sets a very fast repeat rate, adjust to taste.

defaults write -g KeyRepeat -int 0.02

Launchpad

Reset Launchpad Layout

You need to restart Dock because Launchpad is tied to it.

# Up to OS X 10.10 (Yosemite)
rm ~/Library/Application\ Support/Dock/*.db && \
killall Dock

# From OS X 10.11 (El Capitan)
defaults write com.apple.dock ResetLaunchPad -bool true && \
killall Dock

Media

Audio

Convert Audio File to iPhone Ringtone

afconvert input.mp3 ringtone.m4r -f m4af

Create Audiobook From Text

Uses "Alex" voice, a plain UTF-8 encoded text file for input and AAC output.

say -v Alex -f file.txt -o "output.m4a"

Disable Sound Effects on Boot

sudo nvram SystemAudioVolume=" "

Mute Audio Output

osascript -e 'set volume output muted true'

Set Audio Volume

osascript -e 'set volume 4'

Play Audio File

You can play all audio formats that are natively supported by QuickTime.

afplay -q 1 filename.mp3

Speak Text with System Default Voice

say 'All your base are belong to us!'

Startup Chime

Older Macs:

# Enable (Default)
sudo nvram BootAudio=%01

# Disable
sudo nvram BootAudio=%00

From 2016 models on:

# Enable
sudo nvram StartupMute=%00

# Disable (Default)
sudo nvram StartupMute=%01

Video

Auto-Play Videos in QuickTime Player

defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1

Networking

Bonjour

Bonjour Service

# Disable
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist ProgramArguments -array-add "-NoMulticastAdvertisements"

# Enable (Default)
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist ProgramArguments -array "/usr/sbin/mDNSResponder" "-launchd"

DHCP

Renew DHCP Lease

sudo ipconfig set en0 DHCP

Show DHCP Info

ipconfig getpacket en0

DNS

Clear DNS Cache

sudo dscacheutil -flushcache && \
sudo killall -HUP mDNSResponder

Hostname

Set Computer Name/Host Name

sudo scutil --set ComputerName "newhostname" && \
sudo scutil --set HostName "newhostname" && \
sudo scutil --set LocalHostName "newhostname" && \
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "newhostname"

Network Preferences

Network Locations

Switch between network locations created in the Network preference pane.

# Status
scselect

# Switch Network Location
scselect LocationNameFromStatus

Set Static IP Address

networksetup -setmanual "Ethernet" 192.168.2.100 255.255.255.0 192.168.2.1

Networking Tools

Ping a Host to See Whether It’s Available

ping -o herrbischoff.com

Troubleshoot Routing Problems

traceroute herrbischoff.com

SSH

Permanently Add Private Key Passphrase to SSH Agent

Prior to macOS 10.12 (Sierra), ssh would present a dialog asking for your passphrase and would offer the option to store it into the keychain. This UI was deprecated some time ago and has been removed.

Instead, a new UseKeychain option was introduced in macOS 10.12 (Sierra) allowing users to specify whether they would like for the passphrase to be stored in the keychain. This option was enabled by default on macOS 10.12 (Sierra), which caused all passphrases to be stored in the keychain.

This was not the intended default behavior, so this has been changed in macOS 10.12.2. (Source)

ssh-add -K /path/to/private_key

Then add to ~/.ssh/config:

Host server.example.com
    IdentityFile /path/to/private_key
    UseKeychain yes

Remote Login

# Enable
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

# Disable (Default)
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

TCP/IP

Show Application Using a Certain Port

This outputs all applications currently using port 80.

sudo lsof -i :80

Show External IP Address

Works if your ISP doesn't replace DNS requests (which it shouldn't).

dig +short myip.opendns.com @resolver1.opendns.com

Alternative that works on all networks.

curl -s https://api.ipify.org && echo

Show Network Interface Information

Undocumented flag of the scutil command.

scutil --nwi

TFTP

Start Native TFTP Daemon

Files will be served from /private/tftpboot.

sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist && \
sudo launchctl start com.apple.tftpd

Wi-Fi

Join a Wi-Fi Network

networksetup -setairportnetwork en0 WIFI_SSID WIFI_PASSWORD

Scan Available Access Points

Create a symbolic link to the airport command for easy access:

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport

Run a wireless scan:

airport -s

Show Current SSID

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'

Show Local IP Address

ipconfig getifaddr en0

Show Wi-Fi Connection History

defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep LastConnected -A 7

Show Wi-Fi Network Passwords

Exchange SSID with the SSID of the access point you wish to query the password from.

security find-generic-password -D "AirPort network password" -a "SSID" -gw

Turn on Wi-Fi Adapter

networksetup -setairportpower en0 on

Package Managers

  • Fink - The full world of Unix Open Source software for Darwin. A little outdated.
  • Homebrew - The missing package manager for OS X. The most popular choice.
  • MacPorts - Compile, install and upgrade either command-line, X11 or Aqua based open-source software.

Homebrew

Full Uninstall

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

Printing

Clear Print Queue

cancel -a -

Expand Print Panel by Default

defaults write -g PMPrintingExpandedStateForPrint -bool true && \
defaults write -g PMPrintingExpandedStateForPrint2 -bool true

Quit Printer App After Print Jobs Complete

defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true

Security

Application Firewall

Firewall Service

# Show Status
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate

# Enable
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on

# Disable (Default)
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off

Add Application to Firewall

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /path/to/file

Gatekeeper

Add Gatekeeper Exception

spctl --add /path/to/Application.app

Remove Gatekeeper Exception

spctl --remove /path/to/Application.app

Manage Gatekeeper

Especially helpful with the annoying macOS 10.15 (Catalina) system popup blocking execution of non-signed apps.

# Status
spctl --status

# Enable (Default)
sudo spctl --master-enable

# Disable
sudo spctl --master-disable

Passwords

Generate Secure Password and Copy to Clipboard

LC_ALL=C tr -dc "[:alnum:]" < /dev/urandom | head -c 20 | pbcopy

Physical Access

Launch Screen Saver

# Up to macOS 10.12 (Sierra)
open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app

# From macOS 10.13 (High Sierra)
/System/Library/CoreServices/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine

Lock Screen

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

Screensaver Immediate Lock

# Status
defaults read com.apple.screensaver askForPasswordDelay

# Enable (Default)
defaults write com.apple.screensaver askForPasswordDelay -int 0

# Disable (Integer = lock delay in seconds)
defaults write com.apple.screensaver askForPasswordDelay -int 10

Screensaver Password

# Status
defaults read com.apple.screensaver askForPassword

# Enable
defaults write com.apple.screensaver askForPassword -int 1

# Disable (Default)
defaults write com.apple.screensaver askForPassword -int 0

Privacy Database

The tccutil command manages the privacy database, which stores decisions the user has made about whether apps may access personal data. You need to close all applications except Terminal before running any of these commands.

# Full Reset for All Applications
sudo tccutil reset All

# Reset Adress Book Access
sudo tccutil reset AddressBook

# Reset All Permission for Terminal.app
sudo tccutil reset All com.apple.Terminal

Wiping Data

Note: The srm command appears to have been removed on MacOS after 10.9. There is a note on an Apple support page hinting as to why:

With an SSD drive, Secure Erase and Erasing Free Space are not available in Disk Utility. These options are not needed for an SSD drive because a standard erase makes it difficult to recover data from an SSD.

Securely Remove File

srm /path/to/file

Securely Remove Folder

srm -r /path/to/folder/

Securely Remove Path (Force)

srm -rf /path/to/complete/destruction

Search

Find

Recursively Delete .DS_Store Files

find . -type f -name '.DS_Store' -ls -delete

Locate

Build Locate Database

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

Search via Locate

The -i modifier makes the search case insensitive.

locate -i *.jpg

System

AirDrop

AirDrop over Ethernet on Unsupported Macs

# Enable
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true && \
defaults remove com.apple.NetworkBrowser DisableAirDrop

# Disable (Default)
defaults delete com.apple.NetworkBrowser BrowseAllInterfaces && \
defaults write com.apple.NetworkBrowser DisableAirDrop -bool true

AppleScript

Execute AppleScript

osascript /path/to/script.scpt

Basics

Compare Two Folders

diff -qr /path/to/folder1 /path/to/folder2

Copy Large File with Progress

Make sure you have pv installed and replace /dev/rdisk2 with the appropriate write device or file.

FILE=/path/to/file.iso pv -s $(du -h $FILE | awk '/.*/ {print $1}') $FILE | sudo dd of=/dev/rdisk2 bs=1m

Restore Sane Shell

In case your shell session went insane (some script or application turned it into a garbled mess).

stty sane

Restart

sudo reboot

Shutdown

sudo poweroff

Show Build Number of OS

sw_vers

Uptime

How long since your last restart.

uptime

Clipboard

Copy data to Clipboard

cat whatever.txt | pbcopy

Convert Clipboard to Plain Text

pbpaste | textutil -convert txt -stdin -stdout -encoding 30 | pbcopy

Convert Tabs to Spaces for Clipboard Content

pbpaste | expand | pbcopy

Copy data from Clipboard

pbpaste > whatever.txt

Sort and Strip Duplicate Lines from Clipboard Content

pbpaste | sort | uniq | pbcopy

FileVault

Automatically Unlock FileVault on Restart

If FileVault is enabled on the current volume, it restarts the system, bypassing the initial unlock. The command may not work on all systems.

sudo fdesetup authrestart

FileVault Service

# Status
sudo fdesetup status

# Enable
sudo fdesetup enable

# Disable (Default)
sudo fdesetup disable

iCloud

Force Sign Out

defaults delete MobileMeAccounts

Information/Reports

Generate Advanced System and Performance Report

sudo sysdiagnose -f ~/Desktop/

Installation

Create Bootable Installer

# macOS 13 (Ventura)
sudo /Applications/Install\ macOS\ Ventura.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --nointeraction --downloadassets

# macOS 12 (Monterey)
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --nointeraction --downloadassets

# macOS 11 (Big Sur)
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --nointeraction --downloadassets

# macOS 10.15 (Catalina)
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --nointeraction --downloadassets

# macOS 10.14 (Mojave)
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --nointeraction --downloadassets

# macOS 10.13 (High Sierra)
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --applicationpath /Applications/Install\ macOS\ High\ Sierra.app

# macOS 10.12 (Sierra)
sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --applicationpath /Applications/Install\ macOS\ Sierra.app

# OS X 10.11 (El Capitan)
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

# OS X 10.10 (Yosemite)
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --applicationpath /Applications/Install\ OS\ X\ Yosemite.app
  • For confirmation before erasing the drive, remove –-nointeraction from the command.
  • The optional –-downloadassets flag is new in macOS 10.14 (Mojave). It downloads assets which may be required during installation, like updates.
  • The –-applicationpath flag is deprecated since macOS 10.14 (Mojave) and will throw an error if used.

Download Older OS Versions

Version Codename Download
Mac OS X 10.0 Cheetah n/a
Mac OS X 10.1 Puma n/a
Mac OS X 10.2 Jaguar n/a
Mac OS X 10.3 Panther n/a
Mac OS X 10.4 Tiger n/a
Mac OS X 10.5 Leopard n/a
Mac OS X 10.6 Snow Leopard n/a
Mac OS X 10.7 Lion Direct Download
OS X 10.8 Mountain Lion Direct Download
OS X 10.9 Mavericks n/a
OS X 10.10 Yosemite Direct Download
OS X 10.11 El Capitan Direct Download
macOS 10.12 Sierra Direct Download
macOS 10.13 High Sierra App Store
macOS 10.14 Mojave App Store
macOS 10.15 Catalina App Store
macOS 11 Big Sur App Store
macOS 12 Monterey App Store
macOS 13 Ventura App Store

Kernel Extensions

Display Status of Loaded Kernel Extensions

sudo kextstat -l

Load Kernel Extension

sudo kextload -b com.apple.driver.ExampleBundle

Unload Kernel Extensions

sudo kextunload -b com.apple.driver.ExampleBundle

LaunchAgents

Please see this file.

LaunchServices

Rebuild LaunchServices Database

To be independent of OS X version, this relies on locate to find lsregister. If you do not have your locate database built yet, do it.

sudo $(locate lsregister) -kill -seed -r

Login Window

Set Login Window Text

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Your text"

Memory Management

Purge memory cache

sudo purge

Show Memory Statistics

# One time
vm_stat

# Table of data, repeat 10 times total, 1 second wait between each poll
vm_stat -c 10 1

Notification Center

Notification Center Service

# Disable
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && \
killall -9 NotificationCenter

# Enable (Default)
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

QuickLook

Preview via QuickLook

qlmanage -p /path/to/file

Remote Management

See also: Apple Remote Desktop.

Prevent Double Password Entry

When logging into a Mac remotely via Apple Remote Desktop or VNC, you are sometimes required to enter your password a second time after connecting to the Mac. While you can disable this behavior, it is explicitly not recommend to turn this functionality off unless you are certain that no one else will be able to access your Mac physically when you are away.

# Disable
sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist RestoreMachineState -bool false

# Enable (Default)
sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist RestoreMachineState -bool true

Remote Apple Events

# Status
sudo systemsetup -getremoteappleevents

# Enable
sudo systemsetup -setremoteappleevents on

# Disable (Default)
sudo systemsetup -setremoteappleevents off

Root User

# Enable
dsenableroot

# Disable (Default)
dsenableroot -d

Safe Mode Boot

# Status
nvram boot-args

# Enable
sudo nvram boot-args="-x"

# Disable (Default)
sudo nvram boot-args=""

Save Dialogs

Significantly improve the now rather slow animation in save dialogs.

defaults write NSGlobalDomain NSWindowResizeTime .001

Screenshots

Take Delayed Screenshot

Takes a screenshot as JPEG after 3 seconds and displays in Preview.

screencapture -T 3 -t jpg -P delayedpic.jpg

Save Screenshots to Given Location

Sets location to ~/Desktop.

defaults write com.apple.screencapture location ~/Desktop && \
killall SystemUIServer

Save Screenshots in Given Format

Sets format to png. Other options are bmp, gif, jpg, jpeg, pdf, tiff.

defaults write com.apple.screencapture type -string "png"

Disable Shadow in Screenshots

defaults write com.apple.screencapture disable-shadow -bool true && \
killall SystemUIServer

Set Default Screenshot Name

Date and time remain unchanged.

defaults write com.apple.screencapture name "Example name" && \
killall SystemUIServer

Software Installation

Install PKG

installer -pkg /path/to/installer.pkg -target /

Sidecar

Use on Incompatible Macs

This may or may not work, depending on the age of the machine.

# Enable
defaults write com.apple.sidecar.display AllowAllDevices -bool true && \
defaults write com.apple.sidecar.display hasShownPref -bool true

# Disable (Default)
defaults delete com.apple.sidecar.display

Software Update

Ignore Specific Software Update

The identifier can be found via softwareupdate --list. In the example below, being on macOS 10.14 (Mojave), will ignore all update prompts to macOS 10.15 (Catalina), since the latter removes 32-bit support.

sudo /usr/sbin/softwareupdate --ignore "macOS Catalina"

Install All Available Software Updates

sudo softwareupdate -ia

Set Software Update Check Interval

Set to check daily instead of weekly.

defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1

Show Available Software Updates

sudo softwareupdate --list

Set Software Update Server

This should only be done for testing purposes or unmanaged clients. To use network-wide, either correctly set up DNS along with Apple SUS service and bind your clients via OpenDirectory. Alternatively, use Reposado together with correct network DNS settings to make resolution transparent. Margarita looks nice to have as well.

# Use own SUS
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://su.example.com:8088/index.sucatalog

# Reset to Apple SUS
sudo defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

Software Version

Show System Software Version

There are several ways to obtain different levels of detail.

sw_vers -productVersion
system_profiler SPSoftwareDataType
defaults read loginwindow SystemVersionStampAsString

Spell Checking

Global Spell Checking

# Enable (Default)
defaults delete -g NSAllowContinuousSpellChecking

# Disable
defaults write -g NSAllowContinuousSpellChecking -bool true

Spotlight

Spotlight Indexing

# Disable
mdutil -i off -d /path/to/volume

# Enable (Default)
mdutil -i on /path/to/volume

Erase Spotlight Index and Rebuild

mdutil -E /path/to/volume

Search via Spotlight

mdfind -name 'searchterm'

Show Spotlight Indexed Metadata

mdls /path/to/file

System Integrity Protection

Reboot while holding Cmd + R and open the Terminal application. You will need to reboot for the commands to take effect.

# Status
csrutil status

# Enable (Default)
csrutil enable

# Disable
csrutil disable

Date and Time

List Available Timezones

sudo systemsetup -listtimezones

Set Timezone

sudo systemsetup -settimezone Europe/Berlin

Set Clock Using Network Time

# Status
sudo systemsetup getusingnetworktime

# Enable (Default)
sudo systemsetup setusingnetworktime on

# Disable
sudo systemsetup setusingnetworktime off

Set Menu Bar Clock Output Format

# System Preferences > Date & Time > Time options
# Analogue
sudo defaults write com.apple.menuextra.clock IsAnalog -bool true
# Digital (Default)
sudo defaults write com.apple.menuextra.clock IsAnalog -bool false

# System Preferences > Date & Time > Flash the time separators
# Enable
sudo defaults write com.apple.menuextra.clock FlashDateSeparators -bool true
# Disable (Default)
sudo defaults write com.apple.menuextra.clock FlashDateSeparators -bool false

# Thu 18 Aug 23:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM HH:mm:ss"

# Thu 23:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE HH:mm:ss"

# 18 Aug 23:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM HH:mm:ss"

# 23:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "HH:mm:ss"

# Thu 18 Aug 11:46:18 pm
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm:ss a"


# Thu 11:46:18 pm
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm:ss a"

# 18 Aug 11:46:18 pm
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM h:mm:ss a"

# 11:46:18 pm
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "h:mm:ss a"

# Thu 18 Aug 11:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm:ss"

# Thu 11:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm:ss"

# 18 Aug 11:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM h:mm:ss"

# 11:46:18
# System Preferences > Date & Time > Display time with seconds - Checked [:ss]
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "h:mm:ss"

# Thu 18 Aug 23:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM HH:mm"

# Thu 23:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE HH:mm"

# 18 Aug 23:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM HH:mm"

# 23:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Checked [HH:mm]
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "HH:mm"

# Thu 18 Aug 11:46 pm
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm a"

# Thu 11:46 pm
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm a"

# 18 Aug 11:46 pm
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM h:mm a"

# 11:46 pm
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Checked [a]
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "h:mm a"

# Thu 18 Aug 11:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM h:mm"

# Thu 11:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Checked [EEE]
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm"

# 18 Aug 11:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Checked [d MMM]
sudo defaults write com.apple.menuextra.clock DateFormat -string "d MMM h:mm"

# 11:46
# System Preferences > Date & Time > Display time with seconds - Unchecked
# System Preferences > Date & Time > Use a 24-hour clock - Unchecked
# System Preferences > Date & Time > Show AM/PM - Unchecked
# System Preferences > Date & Time > Show the day of the week - Unchecked
# System Preferences > Date & Time > Show date - Unchecked
sudo defaults write com.apple.menuextra.clock DateFormat -string "h:mm"

# Apply changes immediately
sudo killall SystemUIServer

(Source)

Terminal

Ring Terminal Bell

Rings the terminal bell (if enabled) and puts a badge on it.

tput bel

Alternative Terminals

  • Alacritty - Cross-platform, GPU-accelerated terminal emulator.
  • iTerm2 - A better Terminal.app.
  • kitty - Modern, GPU-accelerated terminal emulator.

Shells

Bash

Install the latest version and set as current user's default shell:

brew install bash && \
echo $(brew --prefix)/bin/bash | sudo tee -a /etc/shells && \
chsh -s $(brew --prefix)/bin/bash
  • Homepage - The default shell for OS X and most other Unix-based operating systems.
  • Bash-it - Community Bash framework, like Oh My Zsh for Bash.

fish

Install the latest version and set as current user's default shell:

brew install fish && \
echo $(brew --prefix)/bin/fish | sudo tee -a /etc/shells && \
chsh -s $(brew --prefix)/bin/fish
  • Homepage - A smart and user-friendly command line shell for OS X, Linux, and the rest of the family.
  • The Fishshell Framework - Provides core infrastructure to allow you to install packages which extend or modify the look of your shell.
  • Installation & Configuration Tutorial - How to Setup Fish Shell with Fisherman, Powerline Fonts, iTerm2 and Budspencer Theme on OS X.

Zsh

Install the latest version and set as current user's default shell:

brew install zsh && \
sudo sh -c 'echo $(brew --prefix)/bin/zsh >> /etc/shells' && \
chsh -s $(brew --prefix)/bin/zsh
  • Homepage - Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
  • Oh My Zsh - An open source, community-driven framework for managing your Zsh configuration.
  • Prezto - A speedy Zsh framework. Enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.
  • zgen - Another open source framework for managing your zsh configuration. Zgen will load oh-my-zsh compatible plugins and themes and has the advantage of both being faster and automatically cloning any plugins used in your configuration for you.

Terminal Fonts

  • Anonymous Pro - A family of four fixed-width fonts designed with coding in mind.
  • Codeface - A gallery and repository of monospaced fonts for developers.
  • DejaVu Sans Mono - A font family based on the Vera Fonts.
  • Fantasque Sans Mono - Designed with functionality in mind, and with some wibbly-wobbly handwriting-like fuzziness that makes it unassumingly cool.
  • Hack - Hack is hand groomed and optically balanced to be your go-to code face.
  • Inconsolata - A monospace font, designed for code listings and the like.
  • Input - A flexible system of fonts designed specifically for code.
  • Meslo - Customized version of Apple's Menlo font.
  • Operator Mono - A surprisingly usable alternative take on a monospace font (commercial).
  • Powerline Fonts - Repo of patched fonts for the Powerline plugin.
  • Source Code Pro - A monospaced font family for user interfaces and coding environments.

Glossary

Mac OS X, OS X, and macOS Version Information

Version Codename Release Date Most Recent Version
Rhapsody Developer Release Grail1Z4 / Titan1U August 31, 1997 DR2 (May 14, 1998)
Mac OS X Server 1.0 Hera March 16, 1999 1.2v3 (October 27, 2000)
Mac OS X Developer Preview n/a March 16, 1999 DP4 (April 5, 2000)
Mac OS X Public Beta Kodiak September 13, 2000 n/a
Mac OS X 10.0 Cheetah March 24, 2001 10.0.4 (June 22, 2001)
Mac OS X 10.1 Puma September 25, 2001 10.1.5 (June 6, 2002)
Mac OS X 10.2 Jaguar August 24, 2002 10.2.8 (October 3, 2003)
Mac OS X 10.3 Panther October 24, 2003 10.3.9 (April 15, 2005)
Mac OS X 10.4 Tiger April 29, 2005 10.4.11 (November 14, 2007)
Mac OS X 10.5 Leopard October 26, 2007 10.5.8 (August 5, 2009)
Mac OS X 10.6 Snow Leopard August 28, 2009 10.6.8 v1.1 (July 25, 2011)
Mac OS X 10.7 Lion July 20, 2011 10.7.5 (September 19, 2012)
OS X 10.8 Mountain Lion July 25, 2012 10.8.5 (12F2560) (August 13, 2015)
OS X 10.9 Mavericks October 22, 2013 10.9.5 (13F1911) (July 18, 2016)
OS X 10.10 Yosemite October 16, 2014 10.10.5 (14F2511) (July 19, 2017)
OS X 10.11 El Capitan September 30, 2015 10.11.6 (15G22010) (July 9, 2018)
macOS 10.12 Sierra September 20, 2016 10.12.6 (16G2136) (September 26, 2019)
macOS 10.13 High Sierra September 25, 2017 10.13.6 (17G14042) (November 12, 2020)
macOS 10.14 Mojave September 24, 2018 10.14.6 (18G9323) (July 21, 2021)
macOS 10.15 Catalina October 7, 2019 10.15.7 (19H2026) (July 20, 2022)
macOS 11 Big Sur November 12, 2020 11.7.1 (20G918) (October 24, 2022)
macOS 12 Monterey October 25, 2021 12.6.1 (21G217) (October 24, 2022)
macOS 13 Ventura October 24, 2022 13.0.1 (22A400) (November 9, 2022)

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment