5 ms·
I just learned about the --forest switch for ps. If you use it, you'll get a tree representing all of the parent and child processes running rather than just a
by aston 18y ago
I just learned about the --forest switch for ps. If you use it, you'll get a tree representing all of the parent and child processes running rather than just a straight up list.
- FlorinAndrei 18y agoOr -f As in: ps axf
- raamdev 18y agoThanks! I've been using a tool called pstree for the same thing (I didn't even realize ps had such a feature). It looks like the ps utility on OS X doesn't support --forest though, so pstree is still useful there. http://freshmeat.net/projects/pstree/ http://freshmeat.net/projects/pstree/
- Dobbs 18y agoThe --forest or as later mentioned the -f does not exist in the freeBSD version of ps (I'm assuming all bsd's). If my understanding is correct OSX uses the freebsd utilities so that would be your reason.
- ivank 18y agohtop can also do this.
- palish 18y ago--forest? Seriously? Metaphors are sometimes confusing. Call it what it is. "Reflection" should have been called "type information", for example, and "--forest" should have been called "--nested".
- yan 18y agoA process tree is known to almost everyone who uses Unix. A forest is, in my opinion, a good name for a collection of trees. Reflection is the ability of something to introspect. The term "self-reflection" dates back to 1652[1], so why change it? "Type information" is inaccurate because reflection can mean more than just getting information about types, like interfacing with the runtime or getting information about the language implementation. I don't think concepts should be misnamed at the expense of accuracy. [1] http://www.merriam-webster.com/dictionary/self-reflection http://www.merriam-webster.com/dictionary/self-reflection
- palish 18y agoThe term "self-reflection" dates back to 1652, so why change it? I'm saying it shouldn't have been used in the first place. It's an awkward, confusing metaphor. Programs aren't "reflecting", because "self-reflection" is something that only a sentient creature can perform. Programs currently have no concept of "self". I'd say "reflection" is less accurate than "type information", which covers at least 95% of use cases, if not more. I don't think concepts should be misnamed at the expense of accuracy. Neither do I. Also, all else being equal, less metaphors are better.
- lacker 18y agoYou're talking about a tool whose name is "ps". Unusual names for commands are par for the Unix course.
- nailer 18y agoProcess. List. Move. Copy. Tape Archiver. They're not unusual, they're short.
- rkowalick 18y agoIn graph theory, a collection of disjoint trees is called a forest.