Monday, November 7, 2011

Truncate nohup.out file in linux

While sending your program output to file called nohup.out, you can't simply delete the file. Since, it is handled in server memory. In that case, you have to empty file using following command.

If you delete nohup.out, while running your program, it will leads to server memory growing and become server unstable.

change the working directory to location where your nohup.out file reside. Then execute the following command to empty the file.

cat /dev/null >nohup.out

NOTE :- nohup.out is in linux for gathering program output data. If you run application as following output will redirect to the nohup.

nohup java -jar testApp.jar