====== macOS specific commands ====== ===== Miscellaneous ===== === Remove application from quarantine === ''sudo xattr -rd com.apple.quarantine Aurora\ HDR\ 2017.app'' === Switch Xcode target === This might be necessary after installing an Xcode or macOS beta. \\ ''%%sudo xcode-select --switch /Application/Xcode-beta.app%%'' === Turn Off Dark Mode for specific app === - Find out app identifier \\ ''osascript -e 'id of app "Subtitle Edit"''' - ''defaults write //AppIdentifier// NSRequiresAquaSystemAppearance -bool Yes'' === Hide and unhide files === == Hiding a file == ''chflags hidden ../BasiliskII_Prefs'' == Unhiding a file == ''chflags nohidden ../BasiliskII_Prefs'' == Show hidden files in Finder == ''defaults write com.apple.finder AppleShowAllFiles YES'' === Hostname lookup for Bonjour/Zeroconf === ''dns-sd -Gv4v6 $BONJOURNAME'' === Unregister application's URI scheme === - Check for registered applications, e.g. \\ ''/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump | grep Transmission'' - Unregister \\ ''/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -u /Applications/Transmission.app'' ---- ===== System software updates ===== == Install all available updates == ''sudo softwareupdate -ia'' == Install latest macOS Installer == ''%%sudo softwareupdate --fetch-full-installer [--full-installer-version 10.15]%%'' == Create physical installatino media == ''sudo /Applications/Install\ macOS\ **Catalina**.app/Contents/Resources/createinstallmedia %%--%%volume /Volumes/MyVolume'' == Ignore a particular update == ''%%sudo softwareupdate --ignore "macOS Catalina"%%'' ===== Mount volumes via SSH/SFTP ===== - Create a mountpoint anywhere\\ ''mkdir /tmp/manuals'' - Mount it\\ ''sshfs -o follow_symlinks,volname=Manuals john:/yoko/manuals /tmp/manuals'' ===== Networking ===== === Show open ports === ''lsof -nP +c 15 | grep LISTEN'' ===== Printing ===== === Show detailed information about (CUPS) printers === == Method 1 == - ''cupsctl WebInterface=yes'' - Visit http://localhost:639/printers/ == Method 2 == - Check for ''DeviceURI'' lines in ''/etc/cups/printers.conf'' === Change existing printer's address === - ''cupsctl WebInterface=yes'' - Open http://localhost:631/printers in your web browser - Click on the printer you want to change. From the **Administration** drop down, select **Modify Printer**. - Log in with your local admin account - Select the new printer IP either from "Discovered Network Printers" or add it manually with **Other Network Printers**. Make sure that you keep the same connection protocol as it says in **Current Connection**. ===== Spotlight ===== ==== Missing results, missing applications ==== === Did you try turning it off and on again? === - ''sudo mdutil -a -i off'' - ''sudo mdutil -a -i on'' ===== Finder ===== ==== Enable "Quit Finder" in menu ==== ''defaults write com.apple.finder QuitMenuItem -bool true; killall Finder'' ==== QuickLook only shows icons instead of actual previews (Monterey) ==== 1. Restart Finder :/