OSXFAQ Mac OS X UNIX Tip-of-the-Day

Week 103 - Unix Commands Reference III (4 April 2005)
by
Adrian Mayo - Editor, OSXFAQ
Tuesday - Commands for System and Kernel Stats
These commands display information on system, memory, and file usage
sc_usage ... display live system call stats
For example, 'sudo sc_usage TextEdit'
fs_usage ... display live file system usage
For example, 'sudo fs_usage TextEdit' then use text edit and open/save files.
lsof ... list open files
For example 'lsof' or 'lsof /dev/console'
fstat ... display file status
For example 'fstat' or 'fstat ~' or 'fsstat ~/letter.doc'
vm_stat ... display virtual memory statistics
Watch out for page-outs increasing by 100's per second: you need to buy more memory or run fewer processes.
(See tips week 88)
latency ... display context switches &interrupts
This must be run as root
dmesg ... display system message buffer
(See tips week 61 - Friday)
ac ... display user connect time for accounting
These commands operate on the kernel.
ktrace ... perform kernel tracing
For example, 'ktrace ls' executes 'ls' and trace it's kernel activity. This produces the file 'ktrace.out'.
kdump ... display a 'ktrace.out' file human readable
For example 'kdump' if the trace file is in the current directory.
Option -f to specify the trace file
zprint ... display information on kernel zones
sysctl ... display and set kernel state variables
Option -a to display all state variables and their current settings
kextload ... kernel extension load
kextunload ... kernel extension unload
kextstat ... display kernel extension statistics
If you want to learn more about Mac OS X Unix visit the Learning Center
click.
- For beginners: Mac OS X Unix Tutorials
- For detailed information on specific topics: Advanced Unix
- For OS X in gereral: Mac OS X Tutorials
|