Removal of the nohup -file during the execution

Removing a file in UNIX does two things:

  • it removes the directory entry for it.
  • if no processes have it open and no other directory entries point to it (hard links), it releases the space.

Your nohupped process will gladly continue to write to the file that used to be called nohup.out, but is now known as nothing but a file descriptor within that process.

You can even have another process create a nohup.out, it won't interfere with the first.

When all hard links are gone, and all processes have closed it, the disk space will be recovered.


if you will delete the nohup.out file, the handle will be lost and it will write only to the file descriptor but if you want to clean out the nohup.out file then just run this

true > nohup.out

it will delete the contents of the file but not the file.

Tags:

Nohup