On Ubuntu 18.04, I have a C++ compiled program MyServer. top -c shows the "command line" correctly as ./MyServer, but the "command name" with top is shown as "main".

I wanted to know how to get the command name to be MyServer.


It appears to be getting the command name from the main thread's name set by pthread_setname_np.

  • The answer is using knowledge that is not present in the question. If you could reformulate the question in such a way that this answer would have been possible to give without psychic powers, then it would be ok. – Kusalananda Nov 16 '19 at 13:10
  • @Kusalananda But I thought that being psychic was required in order to reach a certain rep on the site... – doneal24 Nov 16 '19 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.