$display and $write are the same except $display appends a newline if the string does not have a trailing newline character, $write does not do this.
$fopen opens an output file and gives the open file an integer handle for use by the other commands.
$fclose closes the file and lets other programs access it.
In WRspice, there are two special handles that are automatically open and can't be closed.
0 Print to the pop-up error window. 1 or < 0 Print to the standard output (terminal window).
$fdisplay and $fwrite write formatted data to a file whenever they are executed. They are the same except $fdisplay appends a newline if the string does not have a trailing newline character, $fwrite does not do this.
$fstrobe also writes to a file when executed, but it waits until all other operations in the time step are complete before writing. Thus
initial #1 a=1; b=0; $fstrobe(hand1, a,b); b=1;will write write 1 1 for a and b.
$monitor writes to a file whenever any of its arguments changes.