If I want to stop a program given its tcp port number or its file or named executable, can I run something like
kill -tcpPortNumber $1 where the parameter
$1 is a tcp port number or
kill -filename $1 where the parameter is a filename? The background is a problem in the following question:
The problem does occur in practice and I think that user Bepetersn has a solution that looks like what I mean.
sudo kill $(fuser -n tcp <port_number> 2> /dev/null)
But what I'd like to achieve is that the kill program could take tcp port number and/or filename as a parameter system-wide for any user, including sudo. So is it possible to add parameters system-wide to a system program like kill so that the tcp port number and/or a fileename can be parameters and that this change is permanent for any user including ubuntu sudo?