Aug 20, 2003 #1 csreedhar Programmer Joined Jul 31, 2003 Messages 8 Location IN Hi, How can I find out how many background process or normal process are running in the entire unix system. Could anybody help me out in this.
Hi, How can I find out how many background process or normal process are running in the entire unix system. Could anybody help me out in this.
Aug 20, 2003 #2 Salem Programmer Joined Apr 29, 2003 Messages 2,455 Location GB The various options to the 'ps' command should tell you what you need to know. Upvote 0 Downvote
Aug 21, 2003 #3 JasonDeckard Programmer Joined Mar 20, 2003 Messages 136 Location US ps piped through wc (word count) will tell you how many total processes are running on the system. Code: ps -e | wc -l The number returned by wc may be off a little, as it will also count any status lines ps generates. For example, if 'ps -e' shows: Code: PID TTY TIME COMMAND 0 ? 24:17 swapper 1 ? 36:42 init 2 ? 491:24 vhand 3 ? 4248:51 statdaemon 4 ? 20:01 unhashdaemon 8 ? 191:10 supsched 9 ? 0:00 strmem ...then 'ps -e | wc -l' will return 8, even though only 7 processes are listed. Upvote 0 Downvote
ps piped through wc (word count) will tell you how many total processes are running on the system. Code: ps -e | wc -l The number returned by wc may be off a little, as it will also count any status lines ps generates. For example, if 'ps -e' shows: Code: PID TTY TIME COMMAND 0 ? 24:17 swapper 1 ? 36:42 init 2 ? 491:24 vhand 3 ? 4248:51 statdaemon 4 ? 20:01 unhashdaemon 8 ? 191:10 supsched 9 ? 0:00 strmem ...then 'ps -e | wc -l' will return 8, even though only 7 processes are listed.
Aug 21, 2003 #4 mrn MIS Joined Apr 27, 2001 Messages 3,993 Location GB Try the following > sleep 100 & > bg [1] sleep 100 & This only works if you are the owner of the job, if you log out and back in the process will have been given to root. If the process was run from the command line using the & to force it into the backgroud try ps -ef|grep "&" or try jobs see man page of bg for more info -- | Mike Nixon | Unix Admin | ---------------------------- Upvote 0 Downvote
Try the following > sleep 100 & > bg [1] sleep 100 & This only works if you are the owner of the job, if you log out and back in the process will have been given to root. If the process was run from the command line using the & to force it into the backgroud try ps -ef|grep "&" or try jobs see man page of bg for more info -- | Mike Nixon | Unix Admin | ----------------------------