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 in Unix/Linux examines the contents of a file and performs several tests (including magic number checks) to determine its file type (e.g., ASCII text, executable, PDF). 'ls' lists files, 'cat' displays content, and 'more' is a pager.