Month: January 2014

Map Java Thread Details to Linux processes

  1. Search for Java PID:
    Example ouput:4170 blalub 25 0 6309m 5.2g 10m R 97.5 33.3 732:27.41 java
  2. Get a listing of all Java threads in Java Process with PID 4170:
    top -H -p 4170
  3. Find PID of JBoss:
    jps -l
    Example output: 4170 org.jboss.Main
  4. Using Server PID (4170) for thread dump
    jstack -l 4170 > jstack.log
  5. To find threads from the listing (top -H -p) in jstack.log thread PIDs have to be converted from decimal (listing) to nid hexdecimal (jstack) in jstack output

Hex converter:


Perl one liner replace text in multiple files

delete blablub in all text files

keep original files for backup and attach .orig to file name
delete blablub in all text files

Use input file as source for tar archive

Creation of example file

Compress from file