If you mean on another Pi without a desktop environment, you won't be able to do it the same way. On MATE (and most, if not all, DEs), you use Network Manager to handle network connections, which works only as a GUI and needs to be loaded from the desktop.
To use a network connection on a machine that only has a command line interface, you'd have to manually configure it in the /etc/network/interfaces file. You can check the Debian wiki for more informations. See the "Command Line" part, though there's also informations about connman, which I don't know of, that could be useful.
Note that this seems to be specific to Debian distros (Debian, Raspbian, Ubuntu flavors...), so if you're using something different on your second Pi, this might not apply.
Also, if your second Pi uses Ubuntu MATE too and you're just curious to know how to connect through the command line, you have to know that Network Manager and the interfaces files are incompatible (an interface defined in the /etc/network/interfaces can't be seen by Network Manager). So it's one or the other. On a DE, it's far easier to let NM handle this.