When I issue
ps aux | grep mtp
I get
ubuntu-+ 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/20
So 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?
pkill
(to read its manpage, typeman pkill
), it allows you to kill processes by their filename and other attributes. – Byte Commander Dec 28 '16 at 21:53killall
is also worth a try... eg.killall mtp
. – Baard Kopperud Dec 28 '16 at 22:23killall
andkill
, What's the difference between 'killall' and 'pkill'? may be of interest. – Eliah Kagan Dec 28 '16 at 23:45