commands for terminal lovers

There are some things the interface will just not tell you , or you just need a textual representation for , so here we go (texts in bold are shell commands to be put into Terminal)

open
Apple command , opens a file , just as if you had double-clicked the file’s icon , a wrapper to the os extensions useful in terminal to open a file with the app associated with it.

uptime

17:35 up 31 mins, 2 users, load averages: 0.03 0.10 0.07
Standard unix command showing load and time since boot.
uname -a
Darwin leopard 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386
Apple only command showing kernel and os info.
sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.5
BuildVersion: 9F33
Apple only command showing os name version and build number.
lsof
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
SystemUIS 119 valexa 9u IPv4 0x2e700f8 0t0 UDP *:*
Dock 107 valexa cwd DIR 14,3 1326 2 /
……………………………………………………………………
Unix command showing list of open files/sockets/connections by running processes
EX lsof -c Dock shows all files open by Dock and sudo lsof -i | grep LISTEN shows all listening server applications running
vmmap
Virtual Memory Map of process 107 (Dock)
Output report format: 2.2 — 32-bit process
==== Non-writable regions for process 107
__PAGEZERO 00000000-00001000 [ 4K] —/— SM=NUL /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock
…………………………………………………………………………………
Apple command showing virtual memory of processes , used vmmap Dock for the example
fs_usage

18:05:55.034 lstat /Users/valexa/Library/Preferences 0.000053 fseventsd
18:05:55.036 pwrite F=23 B=0x4000 O=0x00659000 0.000024 mds
18:05:55.434 lstat /valexa/Library/Preferences/com.apple.Terminal.plist 0.000069 mdworker
Apple command showing real time information about all file/network accesses going on (needs to be ran as root)