Voleo bih u ovom trenutku da skrenem pažnju svima, jer je neverovatno koliko ljudi ne zna sintaksu komande
ps na Linuxu, i pored lako dostupne man stranice.
ps podržava dve notacije, BSD i System V (System V je istovremeno i POSIX standard). Razlikuju se po tome što kod BSD notacije nema crtice pre navođenja opcija, a kod SysV ima, kao i po tome što su switchevi podosta različiti. Da nacrtam: crtica ispred argumenata za
ps menja smisao komande.
Recimo, da bi izlistali sve procese na sistemu:
BSD-way:
$ ps ax
SysV-way (POSIX):
$ ps -A
ili
$ ps -e
Odlučite se za jednu sintaksu (ja preferiram BSD, uglavnom iz navike), i koristite samo nju.
Iz man stranice:
Citat:
Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX standards
require that "ps -aux" print all processes owned by a user named "x", as well
as printing all processes that would be selected by the -a option. If the user
named "x" does not exist, this ps may interpret the command as "ps aux"
instead and print a warning. This behavior is intended to aid in transitioning
old scripts and habits. It is fragile, subject to change, and thus should not
be relied upon.
Sa treće strane,
ps -a (mulaz, tebi se obraćam) ima neki potpuno šesti smisao:
Code:
-a Select all processes except session leaders (see getsid(2))
and processes not associated with a terminal.
Očigledno, komanda
ps -a neće izlistati sve procese na sistemu.
[Ovu poruku je menjao random dana 06.06.2005. u 17:56 GMT+1]
int rand(void);
Those who do not understand Unix are condemned to reinvent it, poorly.
Upali lampicu — koristi Jabber!