Sponsored Content
Operating Systems Linux similar command of ptree in linux Post 302494224 by dhzdh on Sunday 6th of February 2011 09:30:02 AM
Old 02-06-2011
You can try to use the "--forest" flag of the ps command.
For example: Here is an excerpt from the output of
ps -ef --forest that I ran on my Ubuntu system.
Code:
root       838     1  0 Jan26 ?        00:00:00 gdm-binary
root       966   838  0 Jan26 ?        00:00:00  \_ /usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
root      1043   966  0 Jan26 tty7     00:00:23      \_ /usr/bin/X :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-pDbgjo/database -nolisten tcp vt7
root      1302   966  0 Jan26 ?        00:00:00      \_ /usr/lib/gdm/gdm-session-worker
test      1788  1302  0 Jan26 ?        00:00:00          \_ gnome-session
test      1822  1788  0 Jan26 ?        00:00:00              \_ /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session
test      1849  1788  0 Jan26 ?        00:00:02              \_ gnome-power-manager
test      1850  1788  0 Jan26 ?        00:00:16              \_ nm-applet --sm-disable
test      1857  1788  0 Jan26 ?        00:00:00              \_ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
test      1859  1788  0 Jan26 ?        00:00:00              \_ bluetooth-applet
test      1860  1788  0 Jan26 ?        00:00:02              \_ gnome-panel
test      1861  1788  0 Jan26 ?        00:00:00              \_ nautilus
test      1862  1788  0 Jan26 ?        00:00:03              \_ metacity --replace
test      2051  1788  0 Jan26 ?        00:00:00              \_ /usr/lib/gnome-disk-utility/gdu-notification-daemon
test      2061  1788  0 Jan26 ?        00:00:00              \_ /usr/lib/evolution/2.28/evolution-alarm-notify
test      2062  1788  0 Jan26 ?        00:00:00              \_ python /usr/share/system-config-printer/applet.py
test      2072  1788  0 Jan26 ?        00:00:06              \_ update-notifier

As you can see, the output shows the hierarchy of the processes, which is what you were interested in.

Unfortunately, the format of the output has been lost on the post, so the inserted output does not demonstrates the hierarchy. The process name part of sons of processes is indented so that it appears more to the right than that of the father.

Moderator's Comments:
Mod Comment Use code tags to preserve formatting

Last edited by Scott; 02-06-2011 at 10:40 AM.. Reason: Code tags
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command similar to doskey

Hello all, I need a help in unix. is there any command in unix similar to doskey in MS Dos. It taked pain to enter the big command again and again.. the up and down arrows do not bring the previous commands on the prompt. so pls let me know if there is any command to enable the doskey kind of... (4 Replies)
Discussion started by: halel
4 Replies

2. Shell Programming and Scripting

equivalent of ptree command in zsh

ptree command is not working in zsh. Could anyone let me know the equivalent of ptree command in zsh. (3 Replies)
Discussion started by: dhams
3 Replies

3. Gentoo

ptree for linux

at work, I'm a UNIX administrator, but at home I use openSUSE 11. One of the commands that I use to assist me in trouble shooting A LOT is called ptree process tree. does anyone know of a ptree for linux? yes, I can just use ps -ef and see who the parent pid is and then 'ps -ef | grep <parent... (4 Replies)
Discussion started by: james.witte
4 Replies

4. Shell Programming and Scripting

another command similar to expect

Hi , I just wondering if there is any command that works similar to the expect command. I'm trying to setup a korn shell script that goes to remote servers and executes a command likes : su - username -c "script to execute " but then it'll prompt for the password so if I can provide... (1 Reply)
Discussion started by: arizah
1 Replies

5. Solaris

Is there a similar tool with authconfig of Linux on Solaris?

Hi Dears, I believe you know authconfig on most of Linux Distributions. However, on Solaris OS, I don't know the similar tool. Could you please share me the tool, if any? Note: I am using SunOS 5.10. (0 Replies)
Discussion started by: crest.boy
0 Replies

6. UNIX for Advanced & Expert Users

[Tip] ptree for Linux

Unix (and Linux) uses a process tree that gives a natural security, by simple inheritance of attributes. The following ptree script shows it. It runs on all Linux flavors. Mostly useful for debugging. #!/bin/sh # Solaris style ptree && exec /usr/bin/ptree "$@" ... (6 Replies)
Discussion started by: MadeInGermany
6 Replies
GNOME-SHELL(1)							    gnome-shell 						    GNOME-SHELL(1)

NAME
gnome-shell - Graphical shell for the GNOME desktop SYNOPSIS
gnome-shell [OPTION...] DESCRIPTION
GNOME shell provides core user interface functions for the GNOME 3 desktop, like switching to windows and launching applications. GNOME shell takes advantage of the capabilities of modern graphics hardware and introduces innovative user interface concepts to provide a visually attractive and easy to use experience. gnome-shell is a required component of the GNOME desktop, i.e. it is listed in the RequiredComponents field of /usr/share/gnome-session/sessions/gnome.session. It is started in the window manager phase of the session. OPTIONS
-r, --replace Replace the running window manager --sm-disable Disable connection to the session manager --sm-client-id=ID Specify session management ID --sm-save-file=FILE Initialize session from FILE --screen=SCREEN X screen to use -d, --display=DISPLAY X Display to use --sync Make X calls synchronous --version Print version and exit --help Display help and exit --mode=MODE Use a specific mode, e.g. "gdm" for login screen --list-modes List possible modes and exit --clutter-display=DISPLAY Clutter the option display (otherwise ignored) FILES
/usr/share/gnome-session/sessions/gnome.session, /usr/share/applications/gnome-shell.desktop. BUGS
The bug tracker can be reached by visiting the website https://bugzilla.gnome.org/buglist.cgi?product=gnome-shell. Before sending a bug report, please verify that you have the latest version of gnome-shell. Many bugs (major and minor) are fixed at each release, and if yours is out of date, the problem may already have been solved. ADDITIONAL INFORMATION
For further information, visit the website http://live.gnome.org/GnomeShell. gnome-shell GNOME-SHELL(1)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy