macOS

Updated: 2018-12-08

SIP(System Integrity Protection) is enabled by default since El Capitan

$ csrutil status
System Integrity Protection status: enabled.

How to Delete Software on macOS

Unlike Windows, there's no Registry in macOS, so programs can be directly deleted.

  • /Applications: software programs, apps can be directly deleted from here
  • /Library and ~/Library: user preferences and resources

Library

  • System Library: /System/Library
  • Local Library: /Library
  • User Library: ~/Library

Wired memory

Critical information stored in RAM by the system, its kernel, and some key application components. This stuff is basically frozen – it allocates its space and never moves to the hard drive or gets replaced with user-level data when RAM becomes scarce. An interesting thing to note about wired memory is that it scales based on how much total system memory is installed. For example, a Mac with 1GB of RAM may show 400MB of wired memory, while a Mac with 4GB of RAM may use 700MB. The more memory you have, the more your Mac wants to use it!

Apple Open Directory

https://en.wikipedia.org/wiki/AppleOpenDirectory

Short-cuts

terminal page up or down: fn+up or fn+down

Read NTFS Portable HardDrives

Use Paragon NTFS for Mac

Library

There are 3 Library folders:

  • /System/Library
  • /Library
  • ~/Library

E.g. download JDK/JRE dmg file from here, Java JDK/JRE will be installed in /Library folder: /Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk

MetaData

$ ps -e | grep md
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds

Path in Mac

Xcode Dev Tools

/Applications/Xcode.app/Contents/Developer/usr/bin

Set JAVA_HOME in Mac OS X::

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

Load ~/.bash_profile

  1. run
$ source ~/.bash_profile
  1. or run
$ bash
  1. or change default setting to bash:

Terminal->Preferences->Shells open with->change Command to "/bin/bash"

Mac OS X Package manager

Mac homebrew http://mxcl.github.com/homebrew/

Mac OS Commands

lsbom

List the contents of an installer's bom (bill of materials) file. This can be used to find out what files an installer will add/replace in your system before running it. It can also list details of a previous install.

$ lsbom -fls  /private/var/db/receipts/org.macports.MacPorts.bom | (cd /; sudo xargs rm)