Problem 1
/dev/null is a device not a command, but is not even required for what you are doing as the remainder of the line is what is clearing the contents of temp:
Problem 2
As the file is being constantly written to, I am not suprised you are having issues opening the file with a graphical editor.
When I am looking at log files, I would tend to either cat the file or use tail -f:
Code:
cat temp
tail -f temp
To reduce the size of a file while it is still being used:
Either use
> {file} this however
*empties* the file completely (not reducing by 80%)
or move the current file to a new location: