How do I make `Cmd` as `Meta` instead of `Option/Alt` key on `emacs` runs on terminal(with `-nw` option)
Programs running in the terminal are rather limited in what keys they can get. Gui apps get all the keys. Normally Cmd will go to the gui app only, because there's no ascii equivalent.


Other people's configurations with mac-command-modifier (or ns-command-modifier depending on which version of Emacs you have) are for the gui version of emacs, Emacs.app.
Inside a terminal, it's the terminal app that decides what happens with Cmd. Typically Cmd is only used for the terminal's own features. Terminal.app offers no way as far as I can see to send Cmd to emacs -nw. If you're using iTerm2.app you can tell it to send option instead of left or right cmd, and then you can have option map to meta.
You can globally swap the two keys in System Preferences, but this will mean Cmd/Option are swapped in all other applications too.


Related: https://emacs.stackexchange.com/questions/32074/cannot-remap-alt-cmd-on-mac-os-in-terminal and https://emacs.stackexchange.com/questions/7761/use-the-command-key-in-terminal-on-osx/32480#32480