Why am I unable to find the pid of a nano process that has a file being edited by root?

I am trying to edit a file using nano and whenever I open the file for editing it gives me the following message:

File /path/to/file is being edited (by root with nano 2.5.3. PID 12345); continue?

Yet I can not find the process id in the list of running processes when I grep the pid or when I list all processes. I am unsure as to how to get to the bottom of this. I'm on an ubuntu 16.04 VM.


Try to use ps aux | grep nano and pidof nano to check if that process actually exists. If not try to find nano temporary file in the same location as your file. It should be name like that: file.save.


The following information should help. 1. Are you using top to find the pid of the process. How are you trying to get it. 2. Have your tried to get the process status. Try ps -ef |grep *Pid shown*

Update your question for further dig at it.