Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Ubuntu Server as a virtual machine (using VirtualBox) on my mac.

Normally on the Mac, I'd press alt + 3 to input the hash (#) sybmol.

However, if I do this in my Ubuntu Server's console, it gives me "Unrecognized Command" when inside nano.

How can I input this symbol? I need this to be able to add comments to my apache configuration file.

Thanks

share|improve this question
1  
Alt + 3? # is Shift + 3, isn't it? –  Rob Dec 30 '11 at 14:50
    
What does normally happen if you press alt-3, e.g. in a text editor? Does it work in bash; is the error just happening in nano? If you enter read in bash, press enter, then press alt-3, what happens? –  slhck Dec 30 '11 at 14:50
    
Consider remapping the character to a different modifier key. In terminals, alt is also used as modifier for keyboard shortcuts. –  Daniel Beck Dec 30 '11 at 14:51
3  
@Rob Only if your world ends at the US border. The British Mac keyboard layout uses Shift-3 for the pound character £. –  Daniel Beck Dec 30 '11 at 14:52
1  
@AlexCoplan Try using the right alt key, maybe it's Alt-Gr and changes things? –  Daniel Beck Dec 30 '11 at 15:20

2 Answers 2

up vote 10 down vote accepted

Alt is used as Meta on your system. That's why it behaves strangely in nano and bash.


On Ubuntu server (command-line only) with British keyboard layout, you need to press the right alt key to get the hash symbol #: Only the right alt is interpreted as alt-gr by your Linux system, and that's the modifier key required on non-Mac OS systems for the alternative characters on the keyboard.

share|improve this answer

Ubuntu 12.04 with UK keyboard, installed on a MacBook Pro. Unfortunately the right-side Alt3 only emits a superscript "2", not the hash, And the left-side Alt3 prints nothing.

Going to System Preferences » Keyboard I can see that my current keyboard is listed as: English (UK, MacIntosh international).

Clicking on the little "keyboard" button at the bottom shows the position of all characters on each key. So for me the hash # is Right-Alt|\ (right Alt, pipe and backslash).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.