Terminal command to return network class
Please reconsider and reformulate your question.

You are mixing private IPv4 address spaces and classful networks (which are deprecated or at least "old-fashioned" since 1993) and you don't consider classless networks.

In the old-fashioned concept of classful networks the leading bits 0 (Class A), 10 (Class B), 110 (Class C), 1110 (Class D) or 1111 (Class E) you get by issueing a proper ifconfig or ipconfig command completely determine the class.

So all IP-addresses starting with 


    0 - 127 belong to Class A
128 - 191 belong to Class B
192 - 223 belong to Class C
224 - 239 belong to Class D
240 - 255 belong to Class E




I can't add this as a comment because it's to long.