My problem: I run a lot of python scripts in background on a remote machine. Some of them need many days. When I type top -U username
to check which script ended and which didn't I get a long list looking like that:
54658 user 20 0 7963464 2.9g 13684 R 100.3 0.8 5921:33 python3
54982 user 20 0 6243164 1.2g 13696 R 100.3 0.3 5920:46 python3
98740 user 20 0 737256 508340 5040 S 0.0 0.1 5226:56 python
The problem is that, as you can see, each process id has, as associated command, python
(or python3
). This makes impossible to understand the correspondence between process id and script. I would really like to have displayed the name of the process there (as it is when running an executable written in C). Is there some way to obtain it?
Please note that:
1) As suggested here I tried making the script an executable itself via chmod +x scriptname
and it didn't get any better. I still see python3
2) If I do ps -U username -o pid,cmd
as suggested here I get a looooong list of processes and this is not really handy.
It seems weird to me but I have been searching for it and it looks like there is no other question like this, so it shouldn't be a duplicate. If it is, please link me to the answer.