1

I find the ps -C <cmd> option very useful, since it lets me limit the output of ps to only those processes started with command name <cmd>.

Compared to performing a grep, I also get the header with columns in the output.

However, it appears I can only do a full command name matching using ps -C <cmd>. In other words, if the command name is /opt/azagent/bin/Agent.Listener run --startuptype service, then only ps -C Agent.Listener will list it, and not any partial match, like ps -C Agent.

Is it possible to perform a partial match using ps -C <cmd> on Debian?

0

have a look at pgrep

NAME

pgrep, pkill - look up or signal processes based on name and other attributes

SYNOPSIS

   pgrep [options] pattern
   pkill [options] pattern
  • I wouldn't say those commands serve the same purpose as ps. – Shuzheng Jul 10 '20 at 12:24

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.