Vertical bar
Vertical Bar
The vertical bar, also known as the pipe symbol, is a character with a variety of uses in computing, mathematics, and other fields. It is represented by the symbol `|` and is commonly found on computer keyboards, often above the backslash `\` key.
Uses in Computing[edit | edit source]
In computing, the vertical bar is a versatile character used in several contexts:
Command Line Interfaces[edit | edit source]
In many command line interfaces, such as Unix-based systems, the vertical bar is used as a pipe operator. It allows the output of one command to be used as the input to another command. For example:
``` ls -l | grep "txt" ```
In this example, the output of the `ls -l` command, which lists files in long format, is piped into the `grep` command to filter for files containing "txt" in their names.
Programming Languages[edit | edit source]
In programming languages, the vertical bar can serve different purposes:
- Logical OR Operator: In languages like C, C++, and Java, the double vertical bar `||` is used as a logical OR operator in conditional statements.
- Bitwise OR Operator: A single vertical bar `|` is used as a bitwise OR operator, which performs a binary OR operation on two numbers.
Regular Expressions[edit | edit source]
In regular expressions, the vertical bar is used as an alternation operator, allowing for the matching of one pattern or another. For example, the pattern `cat|dog` will match either "cat" or "dog".
Uses in Mathematics[edit | edit source]
In mathematics, the vertical bar has several applications:
- Absolute Value: The vertical bar is used to denote the absolute value of a number. For example, `|x|` represents the absolute value of `x`.
- Divisibility: In number theory, the vertical bar is used to indicate divisibility. For example, `a | b` means that `a` divides `b` without a remainder.
- Set Notation: In set theory, the vertical bar is used in set-builder notation to separate the variable from the condition. For example, `{ x | x > 0 }` represents the set of all `x` such that `x` is greater than 0.
Uses in Typography[edit | edit source]
In typography, the vertical bar is used as a separator or delimiter. It can be used to separate items in a list or to denote alternatives in text.
Also see[edit | edit source]
- Pipe (computing)
- Logical OR
- Bitwise operation
- Regular expression
- Absolute value
- Set-builder notation
{{{1}}}
Search WikiMD
Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro / Zepbound) available.
Advertise on WikiMD
WikiMD's Wellness Encyclopedia |
Let Food Be Thy Medicine Medicine Thy Food - Hippocrates |
Translate this page: - East Asian
中文,
日本,
한국어,
South Asian
हिन्दी,
தமிழ்,
తెలుగు,
Urdu,
ಕನ್ನಡ,
Southeast Asian
Indonesian,
Vietnamese,
Thai,
မြန်မာဘာသာ,
বাংলা
European
español,
Deutsch,
français,
Greek,
português do Brasil,
polski,
română,
русский,
Nederlands,
norsk,
svenska,
suomi,
Italian
Middle Eastern & African
عربى,
Turkish,
Persian,
Hebrew,
Afrikaans,
isiZulu,
Kiswahili,
Other
Bulgarian,
Hungarian,
Czech,
Swedish,
മലയാളം,
मराठी,
ਪੰਜਾਬੀ,
ગુજરાતી,
Portuguese,
Ukrainian
Medical Disclaimer: WikiMD is not a substitute for professional medical advice. The information on WikiMD is provided as an information resource only, may be incorrect, outdated or misleading, and is not to be used or relied on for any diagnostic or treatment purposes. Please consult your health care provider before making any healthcare decisions or for guidance about a specific medical condition. WikiMD expressly disclaims responsibility, and shall have no liability, for any damages, loss, injury, or liability whatsoever suffered as a result of your reliance on the information contained in this site. By visiting this site you agree to the foregoing terms and conditions, which may from time to time be changed or supplemented by WikiMD. If you do not agree to the foregoing terms and conditions, you should not enter or use this site. See full disclaimer.
Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.
Contributors: Prab R. Tumpati, MD