Bash/Get ancestry

From Attie's Wiki
Revision as of 17:05, 14 February 2013 by Attie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This simple one-liner will output your full ancestry, starting from you and going up to init. If you don't have permission to read a symlink, a '?' will be shown.

PID=$$; until [ $PID -eq 0 ]; do BIN=$(readlink /proc/$PID/exe || echo "?"); echo "$PID: $BIN"; PID=$(ps -ef | awk "\$2==$PID {print \$3}"); done
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox