News for hackers. Stuff that matters.
Re:A Unix Utility You Should Know About: Pipe Viewer by aston on Monday February 02, 2009 @02:34PM (#462739)
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.
Re:A Unix Utility You Should Know About: Pipe Viewer by raamdev on Monday February 02, 2009 @03:13PM (#462804)
Thanks! 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/

Re:A Unix Utility You Should Know About: Pipe Viewer by Dobbs on Tuesday February 03, 2009 @03:42AM (#463720)
The --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.

Re:A Unix Utility You Should Know About: Pipe Viewer by palish on Monday February 02, 2009 @04:29PM (#462913)
--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".

Re:A Unix Utility You Should Know About: Pipe Viewer by yan on Monday February 02, 2009 @05:09PM (#462983)
A 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

Re:A Unix Utility You Should Know About: Pipe Viewer by palish on Monday February 02, 2009 @08:07PM (#463274)
The 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.

Re:A Unix Utility You Should Know About: Pipe Viewer by rkowalick on Tuesday February 03, 2009 @02:47PM (#464517)
In graph theory, a collection of disjoint trees is called a forest.
Re:A Unix Utility You Should Know About: Pipe Viewer by lacker on Tuesday February 03, 2009 @12:21AM (#463557)
You're talking about a tool whose name is "ps". Unusual names for commands are par for the Unix course.
Re:A Unix Utility You Should Know About: Pipe Viewer by nailer on Tuesday February 03, 2009 @03:01AM (#463685)
Process.

List.

Move.

Copy.

Tape Archiver.

They're not unusual, they're short.

Re:A Unix Utility You Should Know About: Pipe Viewer by FlorinAndrei on Monday February 02, 2009 @03:02PM (#462784)
Or -f

As in:

ps axf

Re:A Unix Utility You Should Know About: Pipe Viewer by ivank on Monday February 02, 2009 @04:09PM (#462881)
htop can also do this.