Skip to content

Instantly share code, notes, and snippets.

@cossio
Last active November 23, 2018 19:49
Show Gist options
  • Save cossio/401785daddb92433d96262103bf3cdc5 to your computer and use it in GitHub Desktop.
Save cossio/401785daddb92433d96262103bf3cdc5 to your computer and use it in GitHub Desktop.
To find the list of processes with PPID = 1.
pgrep -P 1 -u cossio # lists the PID of processes with PPID = 1
pgrep -P 1 -u cossio | xargs ps -p # prints the PID and some more info
pgrep -P 1 -u cossio -f julia | xargs ps -o pid,ppid,command -p # print orphaned julia procs
pgrep -P 1 -u cossio -f julia | xargs kill # kill them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment