# HG changeset patch # User Oleksandr Gavenko # Date 1396368348 -10800 # Node ID e98df1173d31f63bbbe41c8b3ad8a4b7967194f7 # Parent 65068320540145b0aae0497520c7b503b248ded8 Move data in process-managment.txt to stat.rst. diff -r 650683205401 -r e98df1173d31 process-managment.rst --- a/process-managment.rst Mon Mar 24 21:12:19 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ --*- mode: outline; coding: utf-8; fill-column: 78 -*- - -* Process list. - -Warning! ps(1) may not fit column position. To overwrite this set COLUMNS -environment variable or use -w options (use 132 columns to display -information, if the -w option is specified more than once, ps will use as many -columns as necessary without regard for window size). - -** FreeBSD. - -View current user process: - - $ ps - -View all running process: - - $ ps -ax - -** Linux. - -View current user process: - - $ ps - -View all running process: - - $ ps -e - -** Solaris. - -TODO - -** Windows. - -*** Interactive. - - cmd> taskmgr - -*** Static. - - cmd> TaskList -Process Name PID Session Name #Session Memory -========================= ====== ================ ======== ============ -System Idle Process 0 Console 0 28 KB -System 4 Console 0 236 KB -smss.exe 592 Console 0 432 KB -csrss.exe 656 Console 0 4 404 KB -winlogon.exe 680 Console 0 2 792 KB -services.exe 724 Console 0 3 260 KB - -* Killing process. - -** Linux. - -TODO - - $ kill -s - -** Windows. - -TODO which version from which Windows version comes? - - cmd> tskill {|} - - cmd> taskkill /IM notepad.exe - cmd> taskkill /PID 827 - -* Process info. - -Show user, pid, ppid, pgid, sid, jobc, state, time, command, etc. - -** Linux. - - $ ps -f - -** FreeBSD. - - $ ps -j - -or - - $ ps -l - -* Run as another user. - -** Linux. - - $ su - - $ - -or - - $ sudo -u -i - -** Windows. - - $ runas /u: TODO XXX diff -r 650683205401 -r e98df1173d31 stat.rst --- a/stat.rst Mon Mar 24 21:12:19 2014 +0200 +++ b/stat.rst Tue Apr 01 19:05:48 2014 +0300 @@ -6,6 +6,93 @@ ========================= .. contents:: +Process list. +============= + +Linux. +------ + +View current user process:: + + $ ps + +View all running process:: + + $ ps -e + +View process commands:: + + $ ps -e -o pid,cmd + +View detail process info:: + + $ ps -f + +Kill process:: + + $ kill -s $SIG $PID + +View processes interactively:: + + $ htop + +Use ``-w``option for wide output. Use this option twice for unlimited width. + +Run as another user:: + + $ su - $user + $ command + +or:: + + $ sudo -u -i + +FreeBSD. +-------- + +View current user process:: + + $ ps + +View all running process:: + + $ ps -ax + +View detail process info:: + + $ ps -j + $ ps -l + +Windows. +-------- + +View all running process:: + + cmd> TaskList + Process Name PID Session Name #Session Memory + ========================= ====== ================ ======== ============ + System Idle Process 0 Console 0 28 KB + System 4 Console 0 236 KB + smss.exe 592 Console 0 432 KB + csrss.exe 656 Console 0 4 404 KB + winlogon.exe 680 Console 0 2 792 KB + services.exe 724 Console 0 3 260 KB + +View processes interactively:: + + cmd> taskmgr + +Kill process (TODO with which Windows version come?):: + + cmd> tskill {|} + + cmd> taskkill /IM notepad.exe + cmd> taskkill /PID 827 + +Run as another user:: + + $ runas /u: TODO XXX + CPU consumption. ================