@l951b951
list all the processes , one per line
ps aux
of that list get all lines that have the word ‘node’
grep node
of that list get all lines that DO NOT have the word color
grep -v “color”
use awk to print just the process number (second space separated token) from each line
awk ‘{print $2}’
and the use sudo kill -9 to kill it, passing the process number using xargs
xargs sudo kill -9 ???
you can do each as one step
ps aux (partial list)
pi 922 0.0 0.4 6176 4208 pts/0 Ss Feb01 0:01 -bash
root 14676 0.0 0.0 0 0 ? I< 12:34 0:00 [kworker/2:0H]
pi 15250 0.0 0.2 4628 2644 ? Ss 13:55 0:00 bash /home/pi/MagicMirror/run-start.sh
pi 15263 0.0 3.0 86264 28752 ? Sl 13:55 0:00 node node_modules/.bin/electron js/electron.js
pi 15274 15.7 12.0 438576 113952 ? Sl 13:55 5:24 /home/pi/MagicMirror/node_modules/electron/dist/electron js/electron.js
pi 15276 0.0 2.7 134932 26392 ? S 13:55 0:00 /home/pi/MagicMirror/node_modules/electron/dist/electron --type=zygote --no-sandbox
pi 15311 8.2 10.8 342876 103308 ? Sl 13:55 2:49 /home/pi/MagicMirror/node_modules/electron/dist/electron --type=renderer --autoplay-po
pi 15318 0.0 6.0 282764 57060 ? Sl 13:55 0:00 /home/pi/MagicMirror/n pu-process --no-sandbox --gpu-preferences=KAAAAAAAAACAAACAAQAAA
root 15351 0.0 0.0 0 0 ? I 13:55 0:00 [kworker/3:2-eve]
with grep node
pi@raspberrypi:~ $ ps aux | grep node
pi 15263 0.0 3.0 86264 28752 ? Sl 13:55 0:00 node node_modules/.bin/electron js/electron.js
pi 15274 15.6 11.4 433072 108780 ? Sl 13:55 5:29 /home/pi/MagicMirror/node_modules/electron/dist/electron js/electron.js
pi 15276 0.0 2.7 134932 26392 ? S 13:55 0:00 /home/pi/MagicMirror/node_modules/electron/dist/electron --type=zygote --no-sandbox
pi 15311 8.2 10.3 337372 97832 ? Sl 13:55 2:52 /home/pi/MagicMirror/node_modules/electron/dist/electron --type=renderer --autoplay-policy=no-user-gesture-required --no-sandbox --service-pipe-token=E75C637B69C4371629AED884ECD5DCA7 --lang=en-US --app-path=/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar --node-integration=false --webview-tag=false --no-sandbox --background-color=#000000 --num-raster-threads=2 --enable-main-frame-before-activation --enable-compositor-image-animations --service-request-channel-token=E75C637B69C4371629AED884ECD5DCA7 --renderer-client-id=3 --shared-files=v8_context_snapshot_data:100,v8_natives_data:101
pi 15546 0.0 0.0 4372 572 pts/0 S+ 14:30 0:00 grep --color=auto node
etc