Unix: what modifier key does "M-" refer to (e.g. M-C)

UnixNano

Unix Problem Overview


I'm trying to do a case-sensitive search in Nano. The help menu at the bottom of the screen says I can toggle case-sensitivity by typing M-C.

^G Get Help         ^Y First Line       ^T Go To Line       ^W Beg of Par       M-J FullJstify      M-B Backwards
^C Cancel           ^V Last Line        ^R Replace          ^O End of Par       M-C Case Sens       M-R Regexp

I'm not sure how to do this. Does M- refer to a modifier key that should be held while I type C? Or does M- mean I should press some key or key combination before hitting C?

Unix Solutions


Solution 1 - Unix

M refers to the meta key, which is not present on most keyboards. (Its use in software is for primarily historical reasons.) Usually, the meta key is emulated by another key on your keyboard. On Windows and Linux, it is usually the Alt key. On Mac OS X, that key (aka Option) already has other uses, and so Escape is used instead.

Solution 2 - Unix

I do not know for nano, but for emacs, M- stands for the Meta key, which can mean pressing the Alt key simultaneously with the letter key or by pressing Esc key before the letter key. Alt generally only works when using an X version of the application, so when using a dumb terminal, only Esc will work.

Solution 3 - Unix

Esc

For instance, if you wanted to go to the end of the file press

Esc then /

You don't need to hold down Esc as if it were Shift.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondB'View Question on Stackoverflow
Solution 1 - UnixchepnerView Answer on Stackoverflow
Solution 2 - UnixFrederic LachasseView Answer on Stackoverflow
Solution 3 - UnixTravis HeeterView Answer on Stackoverflow