I\'m compiling Scala code and write the output console output in file. I only want to save the last line of the STDOUT in a file. Here is the command:
scalac
Just pipe stdout through tail -n 1 to your file
tail -n 1