Might be a simple problem, but I am running CentOS 5.4 command line remotely. I want to redirect the output of a simple Java file, lets say loop to print a hundred thousand numbers in console to a text file. The thing is, I have to use the 'screen' command to be able to run it in background even if I loose my session with the remote computer and this command does not write to the desired file.
I tried the method screen java MyClass >& log.txt
also screen java MyClass > log.txt
but it does not write to the file. Why is this happening and is there any solution?