Skip to content

Instantly share code, notes, and snippets.

@166MMX
Created April 22, 2014 17:26
Show Gist options
  • Save 166MMX/11187603 to your computer and use it in GitHub Desktop.
Save 166MMX/11187603 to your computer and use it in GitHub Desktop.
pstree with enviornment variables
#!/bin/sh
sudo ps -Eaxwwo user,pid,ppid,pgid,command \
| pstree -g 3 -f - \
| sed -r 's/ ([A-Za-z0-9_]*=)/\n \1/g' \
| sed -r '/^ (HOMEBREW_GITHUB_API_TOKEN|HOMEBREW_NO_EMOJI|JAVA_VERSION|JAVA_HOME|ANT_HOME|GRADLE_HOME|GROOVY_HOME|M2_HOME|M2|LS_OPTIONS|HISTCONTROL)=/ d' \
| sed -r '/^ [A-Za-z0-9_]*PATH=/ {s/PATH=/PATH=\n /;s/:/\n /g}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment