TOC

Mac 目录结构

-> % tree -dL2 /
/
├── Applications
│   ├── Another Redis Desktop Manager.app
│   ├── Apifox.app
│   ├── Beyond Compare.app
│   ├── CopyQ.app
│   ├── DBeaver.app
│   ├── DingTalk.app
│   ├── GitButler.app
│   ├── Install macOS Monterey.app
│   ├── Microsoft Edge.app
│   ├── Nutstore.app
│   ├── OpenVPN Connect
│   ├── OpenVPN Connect.app -> /Applications/OpenVPN Connect/OpenVPN Connect.app
│   ├── Safari.app -> ../System/Cryptexes/App/System/Applications/Safari.app
│   ├── Utilities
│   ├── WeChat.app
│   ├── Wireshark.app
│   ├── iTerm.app
│   ├── wpsoffice.app
│   ├── 优酷.app
│   └── 企业微信.app
├── Library
│   ├── Apple
│   ├── Application Support
│   ├── Audio
│   ├── Bluetooth
│   ├── Bundles
│   ├── Caches
│   ├── Catacomb
│   ├── ColorPickers
│   ├── ColorSync
│   ├── Components
│   ├── Compositions
│   ├── Contextual Menu Items
│   ├── CoreAnalytics
│   ├── CoreMediaIO
│   ├── Developer
│   ├── DirectoryServices
│   ├── Documentation
│   ├── DriverExtensions
│   ├── Extensions
│   ├── Filesystems
│   ├── Fonts
│   ├── Frameworks
│   ├── GPUBundles
│   ├── Google
│   ├── Graphics
│   ├── Image Capture
│   ├── Input Methods
│   ├── InstallerSandboxes
│   ├── Internet Plug-Ins
│   ├── Java
│   ├── KernelCollections
│   ├── Keyboard Layouts
│   ├── Keychains
│   ├── LaunchAgents
│   ├── LaunchDaemons
│   ├── Logs
│   ├── Modem Scripts
│   ├── OSAnalytics
│   ├── OpenDirectory
│   ├── Perl
│   ├── PreferencePanes
│   ├── Preferences
│   ├── Printers
│   ├── PrivilegedHelperTools
│   ├── QuickLook
│   ├── Receipts
│   ├── Ruby
│   ├── Sandbox
│   ├── Screen Savers
│   ├── ScriptingAdditions
│   ├── Scripts
│   ├── Security
│   ├── Speech
│   ├── Spotlight
│   ├── StagedDriverExtensions
│   ├── StagedExtensions
│   ├── StartupItems
│   ├── SystemExtensions
│   ├── SystemMigration
│   ├── SystemProfiler
│   ├── Trial
│   ├── Updates
│   ├── User Pictures
│   ├── User Template
│   ├── Video
│   └── WebServer
├── System
│   ├── Applications
│   ├── Cryptexes
│   ├── Developer
│   ├── DriverKit
│   ├── Library
│   ├── Volumes
│   └── iOSSupport
├── Users
│   ├── Guest
│   ├── Shared
│   └── adm
├── Volumes
│   └── 未命名 -> /
├── bin
├── cores
├── dev
│   └── fd
├── etc -> private/etc
├── home -> /System/Volumes/Data/home
├── opt
├── private
│   ├── etc
│   ├── tmp
│   └── var
├── sbin
├── tmp -> private/tmp
├── usr
│   ├── bin
│   ├── lib
│   ├── libexec
│   ├── local
│   ├── sbin
│   ├── share
│   └── standalone
└── var -> private/var

128 directories

Linux 目录结构

/home -> /System/Volumes/Data/home
/usr
/bin
/sbin
/etc  -> private/etc
/var  -> private/var
/opt
/tmp  -> private/tmp
/dev

应用目录

/Applications/
/System/Applications/
/System/Volumes/Data/Applications/

-> % find / -maxdepth 5 -type d -name "*.app" > /tmp/a
-> % awk -F '/' '{path="";for(i=1;i<NF;i++){path=path $i "/"};c[path]++}END{for(i in c){printf "%5d  %s\n",c[i],i}}' /tmp/a | sort -nr 
  107  /System/Library/CoreServices/
   39  /System/Applications/
   19  /System/Applications/Utilities/
   18  /System/Library/Input Methods/
   18  /Applications/
    5  /Users/adm/Downloads/
    4  /Library/Image Capture/Devices/
    2  /System/Library/Services/
    2  /Library/Input Methods/
    2  /Applications/OpenVPN Connect/
    1  /usr/libexec/
    1  /System/Library/Classroom/
    1  /Applications/Nutstore.app/Contents/
-> % type code
code is /usr/local/bin/code
-> % ll /usr/local/bin/code
lrwxr-xr-x@ 1 adm  admin   167B  9 20 21:40 /usr/local/bin/code -> /private/var/folders/lh/vyr5k29j1cgbmd4b_lhpxq340000gn/T/AppTranslocation/F14FB3FE-0B4C-4F60-81FA-7AD83514E78D/d/Visual Studio Code.app/Contents/Resources/app/bin/code
-> % echo $TMPDIR
/var/folders/lh/vyr5k29j1cgbmd4b_lhpxq340000gn/T/
如果你有魔法,你可以看到一个评论框~