I am trying to get PID with process name (e. myprocess) using pidof in bash console, but it does not wok.
I used this to change my process name in my python script: setproctitle.setproctitle("somerandomname")
, when I use pidof -s somerandomname
I get nothing. I also tried PID=$(ps aux | grep "/home/artembakhanov/script.py" | awk '{print $2}')
, but I got an error: Error, do this: mount -t proc proc /proc
. How can I get PID? Thanks!