Monday, March 24, 2014

Truncate running nohup.out file in Unix

Truncate running nohup.out file in Unix
Sometimes because of faulty logger implementations or a process which is running for a long time in Unix
Operating System, background console output file “nohup.out” continues to grow in size and finally we need
to restart the process to either remove this or truncate this.

The below command will empty the “nohup.out” file without impacting running process:


UNIX_SHELL$   >   nohup.out


Or

UNIX_SHELL$  cat   /dev/null   >   nohup.out