Ubuntu – How to list all processes owned by the user

process

List all process names for my user.

I could do it with

ps aux | grep username

But the output would be like:

maythux  18343  0.0  0.1 1070868 34504 ?       Sl   Jun03   0:07 empathy
maythux  21562  0.0  0.1 703716 32104 ?        Sl   Jun10   0:00 /usr/bin/python /usr/bin/blueman-applet
maythux  21574  0.0  0.0  53532  2408 ?        S    Jun10   0:00 /usr/bin/obex-data-server --no-daemon 
maythux  25197  0.0  1.0 2199840 258576 ?      Sl   May27   0:24 remmina

But I just want the output look like:

empathy
blueman-applet
obex-data-serve
remmina

So what is the easiest way to do that?

Best Answer

  • You can easily do it with the ps command itself without any other tool:

    ps -U user-name -o comm= 
    

    If you want to sort and remove duplicate entries you can do this:

    ps -U user-name -o comm= | sort | uniq
    

    Here's a sample of my output:

    liferea
    mission-control
    nacl_helper
    nautilus
    nm-applet
    notify-osd
    nxclient.bin
    nxnode.bin
    obex-data-serve
    okular
    polkit-gnome-au