Multiple choice technology operating systems

Which commands are recommended to clear the contents an active file called log-file? (Select two.)

  1. >log-file

  2. trim log-file

  3. freset log-file

  4. cat /dev/null > log-file

Reveal answer Fill a bubble to check yourself
A,D Correct answer
Explanation

Both '>log-file' (redirecting empty output) and 'cat /dev/null > log-file' redirect null/empty content to the file, effectively clearing it while preserving the file inode.