One Day One Cmd

Place for playing with commands…

Monthly Archives: August 2011

Day 95: $ps -ef Command

ODOC: About ps-ef command

Display full information about each of the processes currently running.

Example

praveen@praveen:~$ ps -ef

This cmd will display details like tis

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 08:16 ?        00:00:00 /sbin/init
root         2     0  0 08:16 ?        00:00:00 [kthreadd]
root         3     2  0 08:16 ?        00:00:00 [ksoftirqd/0]
root         4     2  0 08:16 ?        00:00:00 [migration/0]
root         5     2  0 08:16 ?        00:00:00 [watchdog/0]
root         6     2  0 08:16 ?        00:00:00 [events/0]
root         7     2  0 08:16 ?        00:00:00 [cpuset]
root         8     2  0 08:16 ?        00:00:00 [khelper]
root         9     2  0 08:16 ?        00:00:00 [netns]
root        10     2  0 08:16 ?        00:00:00 [async/mgr]
root        11     2  0 08:16 ?        00:00:00 [pm]
root        12     2  0 08:16 ?        00:00:00 [sync_supers]
root        13     2  0 08:16 ?        00:00:00 [bdi-default]
root        14     2  0 08:16 ?        00:00:00 [kintegrityd/0]
root        15     2  0 08:16 ?        00:00:00 [kblockd/0]
root        16     2  0 08:16 ?        00:00:00 [kacpid]
root        17     2  0 08:16 ?        00:00:00 [kacpi_notify]
root        18     2  0 08:16 ?        00:00:00 [kacpi_hotplug]
root        19     2  0 08:16 ?        00:00:00 [ata_aux]
root        20     2  0 08:16 ?        00:00:00 [ata_sff/0]
root        21     2  0 08:16 ?        00:00:00 [khubd]
root        22     2  0 08:16 ?        00:00:00 [kseriod]
root        23     2  0 08:16 ?        00:00:00 [kmmcd]
root        25     2  0 08:16 ?        00:00:00 [khungtaskd]
root        26     2  0 08:16 ?        00:00:00 [kswapd0]
root        27     2  0 08:16 ?        00:00:00 [ksmd]
root        28     2  0 08:16 ?        00:00:00 [aio/0]
root        29     2  0 08:16 ?        00:00:00 [ecryptfs-kthrea]
root        30     2  0 08:16 ?        00:00:00 [crypto/0]
root        36     2  0 08:16 ?        00:00:00 [scsi_eh_0]
root        37     2  0 08:16 ?        00:00:00 [scsi_eh_1]
root        40     2  0 08:16 ?        00:00:00 [kstriped]
root        41     2  0 08:16 ?        00:00:00 [kmpathd/0]
root        42     2  0 08:16 ?        00:00:00 [kmpath_handlerd]
root        43     2  0 08:16 ?        00:00:00 [ksnapd]
root        44     2  0 08:16 ?        00:00:00 [kondemand/0]
root        45     2  0 08:16 ?        00:00:00 [kconservative/0]
root       210     2  0 08:16 ?        00:00:00 [usbhid_resumer]
root       236     2  0 08:16 ?        00:00:00 [flush-8:0]
root       237     2  0 08:16 ?        00:00:00 [jbd2/sda7-8]
root       238     2  0 08:16 ?        00:00:00 [ext4-dio-unwrit]
root       282     1  0 08:17 ?        00:00:00 upstart-udev-bridge --daemon
root       285     1  0 08:17 ?        00:00:00 udevd --daemon
root       606   285  0 08:17 ?        00:00:00 udevd --daemon
root       661   285  0 08:17 ?        00:00:00 udevd --daemon
syslog     967     1  0 08:17 ?        00:00:00 rsyslogd -c4
102       1001     1  0 08:17 ?        00:00:00 dbus-daemon --system --fork
root      1022     2  0 08:17 ?        00:00:00 [i915]
root      1027     1  0 08:17 ?        00:00:00 NetworkManager
avahi     1033     1  0 08:17 ?        00:00:00 avahi-daemon: running [praveen.l
avahi     1040  1033  0 08:17 ?        00:00:00 avahi-daemon: chroot helper
root      1044     1  0 08:17 ?        00:00:00 /usr/sbin/modem-manager
root      1061     1  0 08:17 ?        00:00:00 /sbin/wpa_supplicant -u -s
root      1062  1027  0 08:17 ?        00:00:00 /sbin/dhclient -d -sf /usr/lib/N
root      1126     1  0 08:17 tty4     00:00:00 /sbin/getty -8 38400 tty4
root      1128     2  0 08:17 ?        00:00:00 [kslowd000]
root      1131     2  0 08:17 ?        00:00:00 [kslowd001]
root      1145     1  0 08:17 tty5     00:00:00 /sbin/getty -8 38400 tty5
root      1162     1  0 08:17 tty2     00:00:00 /sbin/getty -8 38400 tty2
root      1164     1  0 08:17 tty3     00:00:00 /sbin/getty -8 38400 tty3
root      1171     1  0 08:17 tty6     00:00:00 /sbin/getty -8 38400 tty6
root      1174     1  0 08:17 ?        00:00:00 acpid -c /etc/acpi/events -s /va
root      1179     1  0 08:17 ?        00:00:00 anacron -s
root      1182     1  0 08:17 ?        00:00:00 cron
daemon    1183     1  0 08:17 ?        00:00:00 atd
root      1189     1  0 08:17 ?        00:00:00 gdm-binary
root      1220     1  0 08:17 ?        00:00:00 /usr/sbin/console-kit-daemon --n
root      1322  1189  0 08:17 ?        00:00:00 /usr/lib/gdm/gdm-simple-slave --
mysql     1330     1  0 08:17 ?        00:00:00 /usr/sbin/mysqld
root      1358     1  0 08:17 ?        00:00:00 /usr/sbin/cupsd -C /etc/cups/cup
root      1390     1  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1395  1390  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1396  1390  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1397  1390  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1398  1390  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1399  1390  0 08:17 ?        00:00:00 /usr/sbin/apache2 -k start
root      1442  1322  3 08:17 tty7     00:00:18 /usr/bin/X :0 -nr -verbose -auth
root      1483  1322  0 08:17 ?        00:00:00 /usr/lib/gdm/gdm-session-worker
praveen   1547  1483  0 08:17 ?        00:00:00 gnome-session
praveen   1580  1547  0 08:17 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus
praveen   1583     1  0 08:17 ?        00:00:00 /usr/bin/dbus-launch --exit-with
praveen   1584     1  0 08:17 ?        00:00:00 /bin/dbus-daemon --fork --print-
praveen   1600     1  0 08:17 ?        00:00:00 /usr/lib/libgconf2-4/gconfd-2
root      1652     1  0 08:17 tty1     00:00:00 /sbin/getty -8 38400 tty1
praveen   1653  1547  0 08:17 ?        00:00:00 gnome-power-manager
praveen   1659     1  0 08:17 ?        00:00:00 /usr/bin/gnome-keyring-daemon --
praveen   1663     1  0 08:17 ?        00:00:00 /usr/lib/gnome-settings-daemon/g
root      1667     1  0 08:17 ?        00:00:00 /usr/lib/upower/upowerd
praveen   1688     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfsd
root      1693     1  0 08:17 ?        00:00:00 /usr/lib/policykit-1/polkitd
praveen   1708     1  0 08:17 ?        00:00:00 /usr/lib/gvfs//gvfs-fuse-daemon
praveen   1719  1547  0 08:17 ?        00:00:00 nm-applet --sm-disable
praveen   1723  1547  0 08:17 ?        00:00:00 /usr/bin/python /usr/bin/blueman
praveen   1730  1547  0 08:17 ?        00:00:01 metacity --replace
praveen   1731  1547  0 08:17 ?        00:00:00 /usr/lib/evolution/2.30/evolutio
praveen   1734  1547  0 08:17 ?        00:00:00 bluetooth-applet
praveen   1736  1547  0 08:17 ?        00:00:01 nautilus
praveen   1738  1547  0 08:17 ?        00:00:01 gnome-panel
praveen   1740     1  0 08:17 ?        00:00:00 /usr/bin/pulseaudio --start --lo
praveen   1741  1547  0 08:17 ?        00:00:00 /usr/lib/policykit-1-gnome/polki
rtkit     1746     1  0 08:17 ?        00:00:00 /usr/lib/rtkit/rtkit-daemon
praveen   1775  1740  0 08:17 ?        00:00:00 /usr/lib/pulseaudio/pulse/gconf-
praveen   1783     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfsd-trash --spaw
praveen   1787     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfs-gdu-volume-mo
root      1796     1  0 08:17 ?        00:00:00 /usr/lib/udisks/udisks-daemon
praveen   1802     1  0 08:17 ?        00:00:00 /usr/lib/bonobo-activation/bonob
root      1803  1796  0 08:17 ?        00:00:00 udisks-daemon: polling /dev/sr0
praveen   1816     1  0 08:17 ?        00:00:02 /usr/lib/gnome-panel/wnck-applet
praveen   1817     1  0 08:17 ?        00:00:00 /usr/lib/gnome-applets/trashappl
praveen   1823     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfs-afc-volume-mo
praveen   1826     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfs-gphoto2-volum
praveen   1831     1  0 08:17 ?        00:00:00 /usr/bin/obex-data-server --no-d
praveen   1838     1  0 08:17 ?        00:00:00 /usr/lib/gnome-panel/clock-apple
praveen   1839     1  0 08:17 ?        00:00:00 /usr/lib/gnome-panel/notificatio
praveen   1841     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfsd-burn --spawn
praveen   1853     1  0 08:17 ?        00:00:00 /usr/lib/gvfs/gvfsd-metadata
praveen   1859     1  0 08:17 ?        00:00:00 gnome-screensaver
praveen   1865  1547  0 08:17 ?        00:00:00 /usr/lib/gnome-disk-utility/gdu-
praveen   1867     1  7 08:17 ?        00:00:33 /usr/lib/chromium-browser/chromi
praveen   1869  1867  0 08:17 ?        00:00:00 /usr/lib/chromium-browser/chromi
praveen   1872     1  0 08:17 ?        00:00:00 /usr/lib/chromium-browser/chromi
praveen   1899  1872  0 08:17 ?        00:00:00 /usr/lib/chromium-browser/chromi
praveen   1922  1872  0 08:17 ?        00:00:00 /usr/lib/chromium-browser/chromi
praveen   1952  1547  0 08:17 ?        00:00:00 /usr/bin/python /usr/share/syste
praveen   1954  1872  0 08:17 ?        00:00:02 /usr/lib/chromium-browser/chromi
praveen   1963  1867  2 08:17 ?        00:00:11 /usr/lib/chromium-browser/chromi
praveen   1965  1547  0 08:18 ?        00:00:00 update-notifier
root      1975     1  0 08:18 ?        00:00:00 /usr/bin/python /usr/lib/system-
praveen   2032  1872  2 08:18 ?        00:00:11 /usr/lib/chromium-browser/chromi
root      2053  1179  0 08:22 ?        00:00:00 /bin/sh -c nice run-parts --repo
root      2055  2053  0 08:22 ?        00:00:00 run-parts --report /etc/cron.dai
root      2061  2055  0 08:22 ?        00:00:00 /bin/sh /etc/cron.daily/apt
root      2096  2061  0 08:22 ?        00:00:00 sleep 867
praveen   2142  1872  3 08:22 ?        00:00:05 /usr/lib/chromium-browser/chromi
praveen   2150     1  0 08:23 ?        00:00:00 gedit /home/praveen/Desktop/prav
praveen   2155     1  0 08:24 ?        00:00:00 gnome-terminal
praveen   2158  2155  0 08:24 ?        00:00:00 gnome-pty-helper
praveen   2159  2155  0 08:24 pts/0    00:00:00 bash
praveen   2189  2159  0 08:25 pts/0    00:00:00 ps -ef

With Regards,
S. Praveen

Advertisements

Day 94: $ps Command

ODOC: About ps command
Reports the process status.

Syntax

-a -> List information about all processes most frequently requested: all those except process group leaders and processes not associated with a terminal.

-A -> List information for all processes. Identical to -e, below.

-c -> Print information in a format that reflects scheduler properties as described in priocntl.
The -c option affects the output of the -f and -l options, as described below.

-d -> List information about all processes except session leaders.

-e -> List information about every process now running.

-f -> Generate a full listing.

-j -> Print session ID and process group ID.

-l -> Generate a long listing.

-L -> Print information about each light weight process (lwp) in each selected process.

-P -> Print the number of the processor to which the process or lwp is bound, if any, under an additional column header, PSR.

-y -> Under a long listing (-l), omit the obsolete F and ADDR columns and include an RSS column to report the resident set size of the process. Under the -y option, both RSS and SZ will be reported in units of kilobytes instead of pages.

-g grplist -> List only process data whose group leader’s ID number(s) appears in grplist. (A group leader is a process whose process ID number is identical to its process group ID number.)

-n namelist -> Specify the name of an alternative system namelist file in place of the default. This option is accepted for compatibility, but is ignored.

-o format -> Print information according to the format specification given in format. This is fully described in DISPLAY FORMATS. Multiple -o options can be specified; the format specification will be interpreted as the space-character-separated concatenation of all the format option-arguments.

-p proclist -> List only process data whose process ID numbers are given in proclist.

-s sidlist -> List information on all session leaders whose IDs appear in sidlist.

-t term -> List only process data associated with term. Terminal identifiers are specified as a device file name, and an identifier. For example, term/a, or pts/0.

-u uidlist -> List only process data whose effective user ID number or login name is given in uidlist. In the listing, the numerical user ID will be printed unless you give the -f option, which prints the login name.

-U uidlist -> List information for processes whose real user ID numbers or login names are given in uidlist. The uidlist must be a single argument in the form of a blank- or comma-separated list.

-G gidlist -> List information for processes whose real group ID numbers are given in gidlist. The gidlist must be a single argument in the form of a blank- or comma-separated list.

Examples

praveen@praveen:~$ ps
PID   TTY   TIME   CMD
6874  pts/9   0:00     ksh
6877  pts/9   0:01     csh
418   pts/9   0:00     csh

With Regards,
S. Praveen