sw_vers
— Print Mac OS X operating system version informationsystem_profiler
— Reports system hardware and software configuration.system_profiler SPHardwareDataType
— Hardware overview.hostinfo
— Host information.nvram -p
— Print all of the firmware variables.getconf DARWIN_USER_CACHE_DIR
— Retrieve standard configuration variables/usr/libexec/path_helper
— Helper for constructing PATH environment variableopen -a "Google Chrome" --args --profile-directory=Default
— Open app with argsatsutil fontprotection -fonts
— List protected system fontsplutil -convert xml1 binary-property-list-to-convert.plist
,plutil -convert binary1 XML-property-list-to-convert.plist
_ launchctl stop org.macports.nginx
— Restart nginx`_ launchctl list | grep -i ssh
— Search lanuchd services_ launchctl list | grekp -P '^[0-9]+'
— Show running services_ launchctl list org.macports.nginx
— Show nginx service info
man 7 hier
- BSD filesystems standard layoutdiskutil list
— Lists and disks and theirs partitions._ gdu --si --summarize /^(dev|Volumes)(/^@^F) | gsort -h -r
— Root directory stats: no symlinks, no empty dirs, no /Volumes and /dev
- Prints all the resource limits —
launchctl limit
- Prints kernel variables (here: file limits) —
sysctl -a | grep files
l | grep -P '^[-rwx]+@'
— List hidden files and folderschflags hidden Maildir
— Hide folderchflags nohidden Maildir
— Unmask folderdefaults write com.apple.Finder AppleShowAllFiles -bool yes
— Display hidden files in Finderdefaults write com.apple.Finder AppleShowAllFiles -bool no
— Don't display hidden files in Finder
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
— get information for 802.11 interfacesyudo scutil --nwi
show active network interfacesless /var/log/wifi.log
— WiFi logdscacheutil -q service -a port 22
— Resolve service name at port 22dscacheutil -q service -a name ssh
— Resolve port for ssh servicedscacheutil -q protocol | less
— List available protocolsdscacheutil -q host
— Show parsed hosts filedscl . -list /SharePoints
— List all available network sharesdscl . -read /SharePoints/img
— Display share infodscl . -readall /SharePoints
— Display info for all shares
cupsctl WebInterface=yes
— Enable CUPS Web Interfacelpstat -t
— Shows all status informationlpoptions -p MP495
— Show printer settingslpinfo -v
— Lists the available deviceslpq
— Show printer queue statuscancel 295
— Cancel print job with id 295- Command-Line Printing and Options at the Web Interface
- What does the 'Reset Print System' routine in OS X do?
otool -L /usr/libexec/FDERecoveryAgent
— OSX's version of lddCLICOLOR_FORCE=1 ls -l /bin | grep k
— CLICOLOR_FORCE passes colors through pipeslsappinfo
— Show apps meta-information
dscacheutil -q user -a name sergii
— Display sergii's login infodscl . -search /Users name [email protected]
— Search for local users by assigned email (name alias), full matchdscl . -list /Users | grep vygnan
— Search for local users by name, grepdscl . -search /Users name sergii
— Display sergii's Directory Service infodscl . -read /Users/sergii
— Display sergii's full datadscl -plist . -read /Users/sergii
— Display sergii's full data in plist formatdscl . -list /Users UserShell
— List all users with theirs shells in columns (UserShell — field from read)dscl . -readall /Users UserShell UniqueID
— Display all users and selected properties (nl separated)dscl . -list /Groups
— List all groupsdscl -f /var/db/dslocal/nodes/Default localonly -list /Local/Default/Users
— read data from Directory Service specified folder_ ls -laF /var/db/dslocal/nodes/Default/
— Local Directory Service databaseopen -a "Directory Utility"
— Directory Utility GUI
Open Directory (Apple LDAP directory service)
man 8 opendirectoryd
— Show Open Directory manualodutil show sessions
— Show active sessionsodutil show nodenames
— List all available node namesodutil show configuration /Search
— Show /Search node configurationdseditgroup -o read staff
— Manipulate group records with the Open Directory API (dscl alternative)
mkpassdb -list
— Outputs all of the SASL mechanisms available to the Mac OS X Server Password Server.
_ systemstats --dashboard
man pmset
iostat -w1
— Report I/O statistics every second.kextstat
— Display status of loaded kernel extensions.diskutil info /Volumes/Macintosh
— Mounted volume info_ opensnoop -veg -n php-cgi
— snoop php opens_ rwsnoop -Pn Sublime
— snoop read/writes of Sublime Text_ iosnoop -vei
— Snoop IO, (-A = full)_ execsnoop -v
— Snoop new process execution_ fs_usage -w | grep Safari
_ sc_usage Finder -e -s2
_ diskhits /var/log/system.log
— disk access for the cache misses only.
- Documentation —
man dynamic_pager
, About the Virtual Memory System - Startup item —
defaults read /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
- Disable swap —
_ launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
- Display swap usage —
sysctl vm.swapusage
- Monitor virtual memory stats —
vm_stat 1
- Force disk cache to be purged —
purge
- Display the virtual memory regions allocated in a process —
vmmap
leaks
— Searches for leaked memory — memory that the application has allocated, but has been lost and cannot be freed.sudo leaks -nocontext -nostacks 110
heap
— List all the malloc-allocated buffers in the process's heapstringdups
— Identify duplicate strings or other objects in malloc blocks of a target processiprofiler
mdutil -i off /Volumes/volume
— Turn off indexes at mountPointmdfind
— Finds files matching a given querymdls .gitignore
— Lists the metadata attributes
security
— Command line interface to keychains and Security frameworksecurity dump-keychain -ag login.keychain
— Dump login decrypted items and full ACLsecurity find-internet-password -g -a stk
— Show decrypted password forstk
accountsecurity find-generic-password -g -a AirPort -l thenetwork5GHz
— Display WiFi password
/usr/bin/ssh-add -K
— Save password for ssh keys to the keychain
open /Library/Documentation
— Browse bundled tutorialsls /usr/libexec
— System daemons & system utilitiesp /System/Library/CoreServices/*.app(/:t)
— List core services appsp /System/Library/Services/*(/)
— Other servicesquick-look /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/*.icns
— Preview all icons availablequick-look /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/*Folder*.icns
— Preview folder icons availablecat /etc/periodic/daily/110.clean-tmps
— Periodic job to cleanup tmp files, seeman periodic