To add onto the other answer, there are also several other ways to remotely command ships.
To increase the type and number of remote commands, you have to buy certain software for them. For instance, navigation command software allows you to give them orders to go to a sector or dock at a remote station.
To remotely sell and buy things (including ships), the ship you are in must have the trading system extension software installed and you must have a presence in that sector (the ship you are trying to sell is considered a presence so you can do it remotely).
The only place you can sell ships is at the shipyard. To sell it in the early game, both you in the mercury and your discoverer must dock at the shipyard, then you can either switch ships or sell it.