Mac OS X Primer (Part 2): GNU/Linux -> Mac for software engineers
Ashish Bhatia
·
2014-02-28
·
via ashishb.net
Booting process
- The bootloader loads the kernel stored in
/mach_kernel. Tip: Use
rEFIt as a bootloader for dual booting into GNU/Linux. - Kernel launches the launchd process which is equivalent of init in GNU/Linux.
- launchd
loads startup processes from several directories (/System/Library/LaunchAgents, /System/Library/LaunchDeamons, /Library/LaunchAgents, /Library/LaunchAgents and corresponding files in ~/Library directory)
Directory structure
- /Applications - Holds actual applications. Applications are directories with “.app” extension and contain Mach-O executable and other helper files.
- /Library - Similar to /etc on GNU/Linux. It contains system wide config primarily for applications under /Applications. User-specific settings end up in /Users/$USER/Applications dir.
- /Network - contains network mounts.
- /System - seems to contain system specific data which is not modified regularly
- /Users - Equivalent of /home on GNU/Linux
- /bin - Same as GNU/Linux
- /sbin - Same as GNU/Linux
- /private - /private/tmp is same as /tmp on GNU/Linux. /private/var is same as /var on GNU/Linux. /private/etc seems to contain settings just like /etc on GNU/Linux.
Miscellaneous
The correct
pronunciation is “Oh-es-ten” and not “Oh-es-X”.
Press “D” while booting up to enable diagnostic checks on the system.
Enable
Mouseless copy in iTerm2
Cheatsheet - A helper app that enables you to do a Long press of command button in any app to reveal all app shortcuts. It only works with Cocoa-based apps, and most apps are Cocoa-based.
Fluid - An app that converts a web page into a Mac app.
Mounting a disk image
Note: The process is a bit more
involved with encrypted images.
1
2
| $ hdiutil mount image.iso
...
|
To read binary plist files use plutil
1
2
| $ sudo plutil -p /private/var/db/dslocal/nodes/Default/users/root.plist
...
|
To set/get the hostname from command-line
1
2
3
| $ scutil --get HostName
$ scutil --set HostName NewHostName
...
|
Further readings
- https://www.matisse.net/OSX/darwin_commands.html
- https://www.mitchchn.me/2014/os-x-terminal/
- furbo.org/2014/09/03/the-terminal/
- https://www.wezm.net/technical/2019/10/useful-command-line-tools/
- https://www.dyx.name/posts/macunix.html
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。