If I have this two processes, without knowing their PIDs, is there a way (without writing long scripts) to kill the process using just its arguments (say the one with 456 is to be killed).
rsync -av /123 /backup/123
rsync -av /456 /backup/456
Using scripts, that’s not a problem: use arguments to search for a PID then kill using that PID. Is there anything simpler?
If you’re on linux, use pkill with the string with args of the process you want to kill. The -f flag specifies to match the full string and args to the running process.
Any other flavor of *nix, use ps with flags, pipe to grep, pipe to awk to pull the process id, then pipe to kill.