> (Greater-Than Sign) is ASCII code point 62 (0x3E), Unicode U+003E, and a printable punctuation character. It declares that the value on its left exceeds the value on its right — the mirror image of the less-than sign, with the wide end of the angle swallowing the larger quantity. Comparison is only the beginning of this character's workload. In shell scripting, > redirects a command's output to a file, and >> appends instead of overwriting — a difference of one character that determines whether your log file grows or gets wiped clean. HTML and XML use it to close every tag, pairing with < to bracket the web's skeleton. C++ adopted << and >> for stream insertion and extraction, and the same symbols act as bitwise shift operators across C-family languages. Markdown and email conventions use > to prefix quoted text, nesting replies in a visual hierarchy. The trap that catches even seasoned shell users is accidental truncation: running grep "error" log.txt > log.txt empties the file before grep reads it, because the shell opens the redirect first and truncates the target to zero bytes. The command succeeds, the file now contains nothing, and the errors you were hunting are gone forever. Like its counterpart <, the symbol was introduced by Thomas Harriot in 1631, the two signs forming a matched pair from birth. UTF-8 encodes it as a single byte 0x3E. Unicode classifies it as Sm (Symbol, Math) with the name GREATER-THAN SIGN. The single right-pointing angle quotation mark › (U+203A) and the greater-than-or-equal-to sign ≥ (U+2265) are its most common doppelgängers, neither of which any parser will accept as a substitute.
int a = 7, b = 3;if (a > b) a = b; // clamp down when above maxconst char gt = '>'; // ASCII 62 (0x3E)
> redirects stdout to a file, overwriting it (echo hello > file.txt). >> appends instead of overwriting. 2> redirects stderr. &> redirects both stdout and stderr. These operators are fundamental to Unix pipelines and logging.
While browsers are lenient about unescaped > in text (unlike <), the HTML spec requires escaping it as > inside attributes and certain contexts. More importantly, consistent escaping of both < and > prevents injection vulnerabilities and ensures valid markup.
In JavaScript, >>> is unsigned right shift — it shifts bits right and fills with zeros (not the sign bit). -1 >>> 0 gives 4294967295 (all 32 bits set). Java also has >>>. Most other languages only have >> (arithmetic shift, which preserves the sign bit).
The > selector matches only direct children: div > p selects <p> elements that are immediate children of <div>, not nested deeper. Without >, div p selects ALL descendant <p> elements. The > combinator enables precise styling without affecting deeply nested elements.