The colon represents an empty instruction in the shell. The original text is as follows: : null command [colon]. This is the shell equivalent of a NOP (no op, a do-nothing operation). It may be considered a synonym for the shell builtin true. The : command is itself a Bash builtin, and its exit status is true (0).
So: : file is used to empty the file The following form is a use of Here Document to annotate a code block :BLOCK ... segment ... BLOCK