Created
March 25, 2018 22:23
-
-
Save netman69/43d89ae42333f91c01e938e6e6d1371b to your computer and use it in GitHub Desktop.
show what processes launched the shell with sh oneliner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh -c "cur=\$\$; while true; do cur=\"`ps -o ppid= -p \$cur | sed -e 's/^ *//g'`\"; exe=\"`readlink /proc/\$cur/exe`\"; echo \$exe; test -z \"\$exe\" && break; done" | awk '{ a[i++] = $0 } END { for (j = i - 2; j >= 0;) print a[j--] }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment