# PSRE README Psre is short for **Process Snapshot Regex**. Essentially it is a simple interface to quickly find PIDs of processes based on a regex match on the `cmdline` in `/proc`. The normal operation is to run `ps` with any number of flags, piped to any number of stream processors to extract matching process IDs. With `psre`, the command can be for example, `psre 'reg.*ex'`, to list all processes with `reg` followed anywhere by `ex`. If the user wants to print a list of the commands with the processes, the `-c,--cmdline` option can be passed and the cmdline value will be printed next to the pid following a tab character for easier splitting. **Note** that when using `-c,--cmdline`, the original cmdline files in `/proc` null-byte delimit the arguments of a command, leaving it only partially printable. `psre` replaces those null bytes with the ascii space char (`0x20` or `32 dec`) so the full cmdline is printable. ## Example Usage: Bulk killing stuck processes Sometimes webkit spins up many sub processes which get stuck and only a `kill -9` will shut them down. This can be very cumbersome to fix by hand as there can be many stuck PIDs. To do this easily with `psre`, run the following: ``` kill -9 $(psre webkit --noself) ``` **Note** the `--noself` switch which causes `psre` to filter its own PID from the list so it is not also killed or an error thrown when this command runs.