Skip to content

file

The default option that requires no installation would be to use the file command. For our code example we will work with files from the General Example Files.

file --mime-type <name of the file>
file --mime-type 6285633006_R03C01_Red.idat
6285633006_R03C01_Red.idat: application/octet-stream

Adding the -b flag returns only the MIME type for the selected file without the filename.

file --mime-type -b 9969477031_R02C01_Red.idat
application/octet-stream

Last update: October 7, 2020