Find processes running in a specific directory.

proc in .                  # processes in current directory
proc in ~/projects/myapp   # processes in a specific path
proc in . --by node        # node processes in cwd

The directory can be one that was deleted, such as a removed git worktree: processes still running there are listed. A path that doesn’t exist and has nothing running in it is treated as a typo and exits 4.

Options

Flag Short Description
--by <name> -b Filter by process name
--min-cpu <n>   Minimum CPU %
--min-mem <n>   Minimum memory (MB)
--status <s>   Filter by status: running, sleeping, stopped, zombie
--min-uptime <s>   Minimum uptime in seconds
--parent <pid>   Only children of this parent PID
--sort <key> -s Sort by: cpu, mem, pid, name (default: cpu)
--limit <n> -n Limit results
--json -j Output as JSON
--verbose -v Show command line, cwd, parent PID, uptime

Examples

# everything running in current project
proc in .

# only python processes in this directory
proc in . --by python

# high-CPU processes in a project
proc in ~/Sites/myapp --min-cpu 10

# JSON output for scripting
proc in . --json

See also

by to start from a name, list for all processes.