RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

How do I display user ID associated with a process?

Question:

command which displays the user who invoked the command?

Answer:

ps command will print any user ID associated with any process on the system. To see all processes currently running on a Linux system a "ps" command can be used. The most common options used by ps command are "aux":

 

$ ps aux

The command above will display every process on the system and will include a following information:

  • USER: effective user id of a process owner
  • PID: associated process ID
  • %CPU: CPU time utilization by a process
  • %MEM: Memory ( RAM ) utilization by a process
  • VSZ: virtual memory size of the process in KiB
  • RSS: resident set size, the non-swapped physical memory that a task has used
  • TTY: terminal associated with the process
  • STAT: process state such as running or sleeping
  • START: time when the command started
  • TIME: cumulative CPU time
  • COMMAND: the actual command that started this particular process

There may be many processes running on the system at any time. To narrow down our search we can output only processes associated with particular user:

$ ps -U root

To search for any particular process name we can combine ps command with grep:

$ ps aux | grep init
root     1  0.0  0.0   2876   668 ?    Ss   Feb25   0:02 /sbin/init

Linux questions and answers

Share this linux post:

Submit How do I display user ID associated with a process? in Delicious Submit How do I display user ID associated with a process? in Digg Submit How do I display user ID associated with a process? in FaceBook Submit How do I display user ID associated with a process? in Google Bookmarks Submit How do I display user ID associated with a process? in Stumbleupon Submit How do I display user ID associated with a process? in Technorati Submit How do I display user ID associated with a process? in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download