Check if an account is an alias

According to the documentation there is a command that generates an alias for an account. My question (haven’t found this in the documentation): is there a command that checks if two accounts are master/aliases?

No, not in the client. But for example the nodejs/java SDKs have such a function. This is purely an offline check.

Also note that there is no notion of a “master”. There are simply multiple addresses for the same account (2^24 of them). That is the definition of aliases.