Hello,
If you look at MSDN documentation for Process class you will realize that the GetProcessByName is supported for following platforms only.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
For Unix/Linux you can use SSH and then use
ps -Af | grep "YOUR PROCESS NAME"
The output returned by this command is easily. The typical output is shown below.
UID PID PPID C STIME TTY TIME CMD
hope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87
hope 32097 29197 0 Sep27 pts/87 00:00:00 -csh
hope 7209 32097 0 12:17 pts/87 00:00:00 ps -Af
mysql 18617 18581 0 Jan10 ? 05:36:19 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=my
You can use SharpSSH[
^] library for this purpose.
Regards,