summaryrefslogtreecommitdiff
path: root/README.md
blob: 17e4d76df3401e6d6a0fa285370c8175bb746224 (plain)
    1 # PSRE README
    2 
    3 Psre is short for **Process Snapshot Regex**. Essentially it is a simple
    4 interface to quickly find PIDs of processes based on a regex match on the
    5 `cmdline` in `/proc`. The normal operation is to run `ps` with any number of
    6 flags, piped to any number of stream processors to extract matching process
    7 IDs.
    8 
    9 With `psre`, the command can be for example, `psre 'reg.*ex'`, to list all
   10 processes with `reg` followed anywhere by `ex`. If the user wants to print a
   11 list of the commands with the processes, the `-c,--cmdline` option can be
   12 passed and the cmdline value will be printed next to the pid following a tab
   13 character for easier splitting.
   14 
   15 **Note** that when using `-c,--cmdline`, the original cmdline files in `/proc`
   16 null-byte delimit the arguments of a command, leaving it only partially
   17 printable. `psre` replaces those null bytes with the ascii space char (`0x20`
   18 or `32 dec`) so the full cmdline is printable.

Generated by cgit