Which one below truncates a file?
-
touch <file_name>
-
truncate <file_name>
-
> <file_name>
-
mkzero <file_name>
C
Correct answer
Explanation
The redirect operator '>' followed by a filename truncates the file to zero bytes if no content is written before it. The 'touch' command creates or updates timestamps, 'truncate' is not a standard Unix command, and 'mkzero' does not exist.