The combination of the command mk
and the
standard option -lt allows to select the stars earlier than the spectral
type given on the command line
mk -lt "spectral type"
However, only the spectral type is taken into account, and not the luminosity class.
mk ts -lt B3
lists the stars earlier than B3