Multiple choice technology

Which one below truncates a file?

  1. touch <file_name>

  2. truncate <file_name>

  3. > <file_name>

  4. mkzero <file_name>

Reveal answer Fill a bubble to check yourself
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.