I started a very long running job (expected to take 6 days to finish), and want to see its output, so I did:$ nohup ./thejob.sh > out.txtWhen I need to see the job progress I tail - f the file.but the out.txt file was growing too much and I deleted the file and created it again.$ rm out.txt$ touch out.txtAfter this, no output is sending to the file. I think the job lost the bind to the file. I can see the job is running by using top but I can't see its progress anymore.Is there any way to see it again?
How to see the contents of a file I deleted, but that a process is still writing to
linux;io redirection;nohup;deleted files
The old file isn't yet gone, and you could access it if you know the PID of the process writing to it.  You can go to /proc/<pid>/fd and look at 1 which is it's stdoutThis also means, though, that you haven't reclaimed any space from trying to remove the file.Also, once the process exits, the file will be removed.