Python thread name doesn’t show up on ps or htop

First install the prctl module. (On debian/ubuntu just type sudo apt-get install python-prctl) from threading import Thread import time import prctl def sleeper(): prctl.set_name(“sleeping tiger”) while True: time.sleep(10) print “sleeping” t = Thread(target=sleeper, name=”Sleeper01″) t.start() t.join() This prints $ ps -T PID SPID TTY TIME CMD 22684 22684 pts/29 00:00:00 bash 23302 23302 pts/29 00:00:00 … Read more

search for specific process name in htop

Search Press F3 or / and start typing in the process name to search: highlights closest matching result amongst all entries. Filter If you only want results matching your query to be shown, you could filter instead: press F4 or \ to filter From the htop manual: F3, /: Incrementally search the command lines of … Read more

tech