You can use Linux pkill command to kill a process by name.
Example:
Start a new process with a custom name:
1 2 3 |
## Start a new process with name ## bash -c "exec -a bash -c "exec -a cloudafafire sleep 300" |
Kill a process by name in Linux:
1 2 3 4 5 6 |
## On a separate terminal ## Get the process details ps aux | grep -i cloudafafire ## Kill the process by name in Linux pkill -f cloudafafire |