Multiple choice unix

Which of the following commands is used to identify the type of file by context?

  1. ls

  2. cat

  3. file

  4. more

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The file command examines file contents and determines the file type by analyzing its magic numbers, structure, and content patterns. Unlike ls which only shows metadata, file actually inspects the file's internal characteristics to identify whether it's a text file, executable, image, archive, etc.