27

With the default Raspberry Pi keyboard layout and a US keyboard, when I press Shift+| the result would be ~

and if I press on ~ or Shift+~ I would get a different symbol.

2
  • 1
    Although the duplicate concerns another key, the issue is the same: The default keyboard configuration on Raspbian is for a UK keyboard. Note the accepted answer here will not solve that problem. The easiest way to do this is via raspi-config: raspberrypi.stackexchange.com/a/7485/5538
    – goldilocks
    Mar 22, 2018 at 15:51
  • Don't seem to have enough reputation to post an answer, so commenting to answer the actual question: With Raspbian default setup (i.e. UK keyboard layout configuration) and an American keyboard, the pipe symbol can be entered using right Alt + SHIFT + ` (the key in the top left corner that also has the tilde ~). Left Alt does not seem to do the trick.
    – ssc
    May 8, 2020 at 12:07

2 Answers 2

32

Do other keys not function as you wish, as well? Such as # outputting ?

  1. Make sure you have set the correct locales and default locale using sudo raspi-config.

  2. sudo locale

    • Make sure these are what you think they should be
  3. sudo dpkg-reconfigure keyboard-configuration

  4. sudo reboot

2
  • 1
    This worked once I rebooted; tyvm!
    – Andrew
    Nov 21, 2017 at 23:39
  • While this is what most people should do, it's very frustrating that people who genuinely have this need are lead here by Google and find a question the was never answered. (This is an alternative rather than an answer.) I created a duplicate of this question to get an actual solution. raspberrypi.stackexchange.com/a/81599/8375 And there is at least 1 solution at this point. Mar 20, 2018 at 17:07
3

You can get the | (pipe) symbol using the Shift + \ shortcut. The Shift can be found on the left side of your keyboard, on the second row from bottom.

The \ (backslash) key can usually be found above the Enter key (on the fourth row from bottom).

keyboard with backslash between Enter and Backspace

On other keyboards, it is located on the left side of a keyboard, next to the Shift key: keyboard with backslash on the left

(images are edited versions of pictures found on http://www.wpclipart.com/computer/hardware/keyboard/keyboard_black.png.html and http://www.keyboardco.com/keyboard_images/black_foreign_chicony_keyboard_large.jpg)

6
  • 2
    i used to wonder when SE will start giving answers about "any key", seems like this day has come. nice pics, though =)
    – lenik
    May 18, 2013 at 12:12
  • 2
    A good answer for a question that should never have been asked...
    – daviewales
    May 18, 2013 at 12:37
  • 7
    it doesn't work. That is why I asked the question, I thought it is because of the "gb"(UK) layout, hence I asked for future reference. PS: thank you for the detailed answer
    – Suhaib
    May 18, 2013 at 13:15
  • 2
    You really need to put a lot more detail in your question. Perhaps post a picture of your keyboard, and tell us what symbols appear when you press different keys. That way we can determine what keyboard layout you have, and what you should change it to. (You can do this using raspi-config)
    – daviewales
    May 18, 2013 at 13:58
  • 7
    The problem is that this user has UK locale vs US locale set up. This causes problems with |, as well as ~ and others.
    – earthmeLon
    May 12, 2014 at 17:15

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