I'm trying to create a script that prints top stat for some specific fields (e.g. pid, command, priority, nice value). I can print most of them by using -stats option, but there is no arg for ni and pri there...
I know, that's possible to get if i use ps, but what about top?
1 Answer
Use the latest utility htop instead of top.
-
How would
htophelp? It's just a curses version oftop; he's using it from a scriptMichael Mrozek– Michael Mrozek2013-10-06 08:00:54 +00:00Commented Oct 6, 2013 at 8:00 -
htop is the advance package ... we can do multiple operations while running ...Ganesh Chaudhari– Ganesh Chaudhari2013-10-06 08:02:00 +00:00Commented Oct 6, 2013 at 8:02
topdoesn't have a-statsoption. And it displays priority and niceness by default. And ps should display all processes (if given the right arguments to select them) What system is this on?top -statsgives an error about an unknown option.topcommand on proper linux systems?~/.toprcfile (easily done by configuring it interactively how you'd like, then hittingW). I don't think top is really intended to be used by scripts.