When I issueps aux | grep mtpI getubuntu-+ 15934 0.1 0.0 519848 7068 ? Sl 21:13 0:00  /usr/lib/gvfs/gvfsd-mtp --spawner :1.9 /org/gtk/gvfs/exec_spaw/20So the PID in this case is 15934. But every new time this is run the PID is different. Is there any other way to kill a process other than by PID?
Kill process when PID is constantly changing
process;kill
Probably there is a parent process which kills child processes and forks new children. You can use pstree to find the parent process:pgrep mtp | xargs -i pstree -ps {}Or alternatively you can use the ppid option of ps:pgrep mtp | while read line; do ps -p $line -o ppid; doneThen you can kill the parent process