Skip to content

Instantly share code, notes, and snippets.

@AmaranthLIS
Created August 21, 2017 10:21
Show Gist options
  • Save AmaranthLIS/c979832d6472e27853aa80a725bf4d3c to your computer and use it in GitHub Desktop.
Save AmaranthLIS/c979832d6472e27853aa80a725bf4d3c to your computer and use it in GitHub Desktop.
show and kill process by PID
pstree 32567
pstree -p 32567
pstree -p 32567| perl -ne 'print "$_\n" foreach /\((\d+)\)/g;'
pstree -p 32567| perl -ne '`kill -9 $_` foreach /\((\d+)\)/g;'
pstree -p 32567| perl -ne 'print "$1\n" while /\((\d+)\)/g;'
pstree -p 32567| perl -ne '`kill -9 $1` while /\((\d+)\)/g;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment