Archive for the ‘Linux’ Category

Checking processes in linux

Thursday, March 27th, 2008

ps -exf

Will show you all processes in a form of tree: parent processes and child processes aligned to the right. Here is sample output:

26633 pts/8    S      0:56  |   \_ /usr/local/java/jre/bin/exe/java -
26649 pts/8    S      0:00  |       \_ /usr/local/java/jre/bin/exe/ja
26650 pts/8    S      0:00  |           \_ /usr/local/java/jre/bin/ex
26651 pts/8    S      0:00  |           \_ /usr/local/java/jre/bin/ex
26652 pts/8    S      0:00  |           \_ /usr/local/java/jre/bin/ex
26655 pts/8    S      0:00  |           \_ /usr/local/java/jre/bin/ex
26656 pts/8    S      0:00  |           \_ /usr/local/java/jre/bin/ex

It is good to use this options with ps when viewing multi-threaded java applications running on linux. As java while running on Linux uses separate process for each thread (note, it depends on JVM and Thread library / implementation JVM is using, some implementations will show only main process for java app and threads will not be displayed as children processes ). You will see main process and children of that process (threads) structured as ASCII tree… Nice huh? :)

Crontab file syntax

Sunday, March 9th, 2008

This post is more of a reminder for  myself as I constantly forget on which param means what.

*     *   *   *    *  command to be executed
-     -    -    -    -
|     |     |     |     |
|     |     |     |     +—– day of week (0 – 6) (Sunday=0)
|     |     |     +——- month (1 – 12)
|     |     +——— day of month (1 – 31)
|     +———– hour (0 – 23)
+————- min (0 – 59)