Results 1 to 6 of 6

Thread: How can I get a list of users running processes?

  1. #1
    Join Date
    Jan 2007
    Beans
    193

    How can I get a list of users running processes?

    I'm looking for a command that will give me a list of users (unique, dont name my user account 60 times) that are running processes on a system... Help?

  2. #2
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How can I get a list of users running processes?

    w
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  3. #3
    Join Date
    Oct 2006
    Beans
    4,624
    Distro
    Kubuntu 15.10 Wily Werewolf

    Re: How can I get a list of users running processes?

    Code:
    w
    Edit: tgalati4 beat me to it
    Blog | Ubuntu User #15350 | Zsh FTW | Ubuntu Security | Nothing to hide?
    AMD Phenom II X6 1075T @ 3GHz, Nvidia GTX 650, 8GB DDR3 RAM, 2 X 1TB, 1 X 3TB HDD
    Please don't request support via PM


  4. #4
    Join Date
    Oct 2007
    Location
    England
    Beans
    178
    Distro
    Xubuntu 12.04 Precise Pangolin

    Smile Re: How can I get a list of users running processes?

    I think that is the best reply I have ever seen.

    Its also the shortest, most concise and actually contained the solution to the OP's question... in one character! Haha.

    Well done.
    CPU: Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz
    RAM: CORSAIR XMS3 DHX 4GB ( 2 X 2GB )1333MHz DDR3
    GPU: NVIDIA GeForce GTX 280
    Mobo: XFX nForce 790i Ultra 3-Way SLI

  5. #5
    Join Date
    Jan 2007
    Beans
    193

    Re: How can I get a list of users running processes?

    Indeed. Very funny, except it's not what I asked for.


    Code:
    ps –fa | awk ‘{print NR “ ” $1}’ | sort -u

  6. #6
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,050
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How can I get a list of users running processes?

    You can also use the negate switch with ps for some interesting results:

    tgalati4@tpad-Gloria7 ~ $ ps -f -N -U tgalati4 -U root
    UID PID PPID C STIME TTY TIME CMD
    syslog 2257 1 0 Feb09 ? 00:00:03 /sbin/syslogd -u syslog
    klog 2280 1 0 Feb09 ? 00:00:00 /sbin/klogd -P /var/run/klogd/km
    108 2301 1 0 Feb09 ? 00:01:52 /bin/dbus-daemon --system
    mail 2408 1 0 Feb09 ? 00:00:01 /usr/sbin/nullmailer-send -d
    rwhod 2424 1 0 Feb09 ? 00:00:00 /usr/sbin/rwhod -b
    rwhod 2430 2424 0 Feb09 ? 00:00:00 /usr/sbin/rwhod -b
    111 2514 1 0 Feb09 ? 00:01:07 /usr/sbin/hald
    111 2699 2581 0 Feb09 ? 00:00:00 hald-addon-acpi: listening on ac
    avahi 2802 1 0 Feb09 ? 00:00:01 avahi-daemon: running [tpad-Glor
    avahi 2808 2802 0 Feb09 ? 00:00:00 avahi-daemon: chroot helper
    mail 7112 2408 0 20:04 ? 00:00:00 /usr/lib/nullmailer/smtp -
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •