Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
3  
@AlexCoplan Try using the right alt key, maybe it's Alt-Gr and changes things? – Daniel Beck Dec 30 '11 at 15:20
up vote 16 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-Ctrl|\ (right Alt, pipe and backslash). One of the previous posts said Alt but it was Ctrl

share|improve this answer

I just came across this as I'm doing my LPIC and using a MB Pro running CentOS in a VM.

Ended up being CTRL+\

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .