How to find your Home folder
Open Finder, from the top bar:
Go -> Home
Cmd + Shift + H
Add Home to sidebar: top bar
Sidebar tab -> tick your home folder
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: user preferences and resources
How to Page Up or Page Down
fn + up or
fn + down
How to Read NTFS Portable HardDrives
Use Paragon NTFS for Mac
How to change default shell
Preferences ... ->
General tab ->
Shells open with: -> change
How to install software
- from App Store
- use a Package manager, e.g. brew
How to record screen
- Shift + Cmd + 3: take a screenshot of the full screen
- Shift + Cmd + 4: capture a portion of the screen
- Shift + Cmd + 5: show the toolbar, which can record videos.
How to disable "XXX(app name) pasted from YYY(mac name)"
System Preferences ->
General -> uncheck "Allow Handoff between this Mac and your iCloud devices"
How to check disks?
$ diskutil list
SSD(0) vs HDD(1)
Under the hood
SIP (System Integrity Protection) is enabled by default since El Capitan. It prevents modification of certain files.
$ csrutil status System Integrity Protection status: enabled.
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!
Metadata Framework creates index of your content, which enables Spotlight Search (
cmd + spacebar).
mds = metadata server
$ ps -e | grep mds /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds
Apple File System (APFS) allocates disk space on demand.
/usr/binon "Macintosh HD" (a dedicated, read-only system volume)
- others on "Macintosh HD - Data" (your files and data)
- use firmlinks to stitch them up.
Firmlinks: Bi-directional wormhole in path traversal
- Consistent forward and backward traversal of the file name space
- Only for directories
- Created on the system volume at installation time
- Not expected to be noticed by a user or an application
If you run
df you may find something like
Naming convention: diskCsVsS
- C is an APFS Container. This is a virtual disk constructed by APFS to represent a collection of APFS Volumes. Multiple APFS Containers can be active simultaneously.
- V is an APFS Volume; it refers to a virtual logical volume that is shared out of an APFS Container.
- S is an APFS Snapshot; it refers to a frozen moment in time of the state of files on an APFS Volume.
Apple Open Directory
LDAP directory service
- System domain: low level stuff, installed by Apple. Under
- Local domain: shared by all users.
- User domain: user specific, under
/System/Applications: applications pre-installed by Apple
e.g. Xcode Dev Tools:
There are 3
- System Library:
- Local Library:
- User Library:
(Since Catalina) macOS has a read-only system volume and a read-write user volume interleaved on a folder by folder basis using firmlinks.
/Volumes: your hard drive is mounted here
/System/Volumes/VM: virtual memory
$ sudo rm -rf ~/.Trash/*
/cores folder is where macOS stores Core Dumps. These are files that are intended for developers to trouble-shoot and diagnose faults in their software.
/tmp: temporary files
/var: e.g. log files
/opt: optional, not part of a unix distribution. E.g.
macOS Commands and Binaries
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)
$ diskutil apfs list
systemd equivelent in macOS.
kernel_task: PID 0
macOS missing commands
tree. To install:
$ brew install tree
Check if your software is ready for Apple silicon: https://isapplesiliconready.com/
Rosetta 2: announced in 2020, to aid in the Mac transition to Apple silicon. The software permits many applications compiled exclusively for execution on x86-64-based processors to be translated for execution on Apple silicon.
Universal 2 binary format: also introduced in 2020, allows applications to run on both Intel x86-64-based and ARM64-based Macintosh computers, to enable the transition to Apple silicon.
(Why 2? 1 was for transition from PowerPC to Intel)