how to get file type in linux

C++
file <filename>find . -iname "*.err"
Source

Also in C++: