troubleshooting Question

UNIX TOP command (grep for string)

Avatar of cjb123
cjb123 asked on
Unix OSLinux
6 Comments1 Solution771 ViewsLast Modified:

I'd like to direct TOP output to a file, but only select lines from TOP where a certain COMMAND (program name) is running.

For instance, If a command running is called DP800, when I do this:

top -b -d1  | grep DP800 > wiltop.txt

The redirect is formatted strangely (i.e. does not look like TOP output) and it seems that the output  spools an entire screen length before being directed to the output file (wiltop.txt)

I tried to use the -U and -p flags to minimize TOP output to the relevant output I need, but those flags did not meet my purpose entirely.

Is there a TOP flag to display output only from certain commands running? (DP800 in my case)

Thanks for any help you can offer.
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros