O'Reilly logo

Expert Shell Scripting by Ron Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 8Shell Process Tree

The process-tree script presented in this chapter does exactly what its name suggests: it prints out the names of some or all of the currently running processes that are present in the process table, displaying the parent/child relationships that exist among them in the form of a visual tree. There is an implementation of this functionality on some versions of Solaris (ptree) and on all flavors of Linux (pstree). These have proved very valuable to me for finding the root of a process group quickly, especially when that part of the process tree needs to be shut down.

There are some UNIX-based operating systems that don't have this functionality, such as HP-UX; hence the reason for this script. Along the way, this script ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required