Wer sich interessiert, was für Prozesse auf einem Mac OS X ausgeführt wird, kann im Terminal den Befehl ps
nutzen.
Hier ein Auszug was auf apfelschwein so abgeht:
apfelschwein:~ andy$ ps auxwww USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND andy 573 4.6 3.8 401904 20020 ?? S Tue11PM 139:58.02 /Applications/iTunes.app/Contents/MacOS/iTunes -psn_0_11141121 andy 885 2.1 18.2 483412 95288 ?? Ss 10:17AM 38:41.46 /Applications/Firefox.app/Contents/MacOS/firefox-bin -psn_0_19136513 -foreground andy 558 0.1 0.6 383836 3280 ?? S Tue10PM 10:41.76 /Applications/VLC.app/Contents/MacOS/VLC -psn_0_10878977 andy 971 0.1 0.2 27728 792 p2 Ss 1:32PM 0:00.02 -bash root 974 0.1 0.1 27316 420 p2 R+ 1:33PM 0:00.00 ps auxwww root 31 0.0 0.1 28364 284 ?? Ss Sun11PM 0:00.04 /usr/sbin/KernelEventAgent root 32 0.0 0.1 28564 664 ?? Ss Sun11PM 0:04.74 /usr/sbin/mDNSResponder -launchdaemon root 33 0.0 0.2 27580 928 ?? Ss Sun11PM 0:01.56 /usr/sbin/netinfod -s local root 34 0.0 0.1 27288 308 ?? Ss Sun11PM 0:00.36 /usr/sbin/syslogd root 37 0.0 0.2 30032 856 ?? Ss Sun11PM 0:03.35 /usr/sbin/configd root 38 0.0 0.2 34516 1124 ?? Ss Sun11PM 0:00.80 /usr/sbin/coreaudiod root 39 0.0 0.1 27776 648 ?? Ss Sun11PM 0:00.52 /usr/sbin/diskarbitrationd root 40 0.0 0.1 28420 472 ?? Ss Sun11PM 0:00.06 /usr/sbin/memberd -x [..]
Die PID ist die Process ID. Jedem Prozess wird eine solche, eindeutige Nummer zugewiesen. Warum dies wichtig ist, wird in den nächsten Posts aufgelöst ;).
ps hat zahlreiche Optionen:
-a Display information about other users' processes as well as your own.
-A Display information about other users' processes including those without controlling terminals.
-c Change the ``command'' column output to just contain the exe- cutable name, rather than the full command line.
-C Change the way the cpu percentage is calculated by using a ``raw'' cpu calculation that ignores ``resident'' time (this normally has no effect).
-e Display the environment as well.
-h Repeat the information header as often as necessary to guarantee one header per page of information.
-j Print information associated with the following keywords: user, pid, ppid, pgid, sess, jobc, state, tt, time and command.
-L List the set of available keywords.
-l Display information associated with the following keywords: uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time and command.
-M Print the threads corresponding to each task.
-m Sort by memory usage, instead of by process ID.
-O Add the information associated with the space or comma separated list of keywords specified, after the process ID, in the default information display. Keywords may be appended with an equals (``='') sign and a string. This causes the printed header to use the specified string instead of the standard header.
-o Display information associated with the space or comma separated list of keywords specified. Keywords may be appended with an equals (``='') sign and a string. This causes the printed header to use the specified string instead of the standard header.
-p Display information associated with the specified process ID.
-r Sort by current cpu usage, instead of by process ID.
-S Change the way the process time is calculated by summing all exited children to their parent process.
-T Display information about processes attached to the device asso- ciated with the standard input.
-t Display information about processes attached to the specified terminal device.
-U Display the processes belonging to the specified username.
-u Display information associated with the following keywords: user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command. The -u option implies the -r option.
-v Display information associated with the following keywords: pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem and command. The -v option implies the -m option.
-w Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard for your window size.
-x Display information about processes without controlling termi- nals.