Type a vertical bar on Mac
On many US QWERTY layouts, hold Shift and press the backslash key. You should get |. Other Mac keyboard layouts can use a different key or modifier.
Find | on another keyboard layout
Open System Settings → Keyboard → Text Input and show Keyboard Viewer. Hold Shift and Option to see how the available symbols change on your current layout.
What is a vertical bar used for?
The vertical bar is common in Terminal, programming, regular expressions and text separators. In a command line it is often called a pipe.
Copy the vertical bar
Copy it here if you only need it once: |
Frequently asked questions
Is | the same as a lowercase l?
No. The vertical bar is a separate symbol, even though some fonts make the two look similar.
Why does Shift + backslash not work?
Your Mac is probably using a different keyboard layout. Keyboard Viewer shows the correct key for the active input source.
Why is | called a pipe?
In shells and command-line tools, the character can pass the output of one command into another, which is why it is commonly called a pipe.