The 'file' command determines a file's type by examining its contents (magic numbers and header bytes), not just the extension. It outputs descriptions like 'ASCII text', 'ELF executable', 'JPEG image', etc. The 'type' command is a shell builtin for displaying command types, 'which' locates commands, and 'grep' searches for text patterns.