nice (user command)

Can someone tell me .. how to find a user & process who has executed nice (scheduled priority) to one of his process. .Tks..

If you do not know the process or the user, what kind of ill affects are you seing on your server that wants you to find a particular process and user?

In Linux, using the top command will give you an updated listing of running processes with their priorities. But without knowing the user or the process, what kind of priority level are you looking for? If you knew the username or process you could do something like this:

top | grep "USERNAME or PROCESS NAME"

Or if you suspected a particular time period that the process is being run you could just run top and watch for any out of the norm processes being run.

This is a good question though, does anyone else have any better solutions to finding the information needed with so many unknowns?

Do a "ps -el" and examine the field labelled "NI". That field is the nice value.

Quick question,

The 'ps' command only gives a snapshot of the current process utilization. If this user is running this process outside of the time that the snapshot is done, won't this be inaffective in determining the user/process being run with a particular nice value.

Yes, ps will only report on processes currently running. If don't catch it at first, you will have to repeat the command. Or you may need to write a script to run ps every 30 seconds or so as a last resort.

Not sure what OS you are using, but if using recent versions of linux, you can use the watch command, for example:

watch ps -el

Neo