SkillAgentSearch skills...

Ugrep

find unicode characters based on their names

Install / Use

/learn @hackerb9/Ugrep

README

<a href="https://raw.githubusercontent.com/hackerb9/ugrep/master/README.md.d/screenshot.png"> <img title="ugrep screenshot" alt-text="Example of ugrep vine" align="right" src="README.md.d/screenshot.png" width="50%"> </a>

☙ ugrep ❧

Find unicode characters based on their names

ugrep is essentially grep for the Unicode table. It prints out the resulting unicode characters literally, so you can easily cut-and-paste. Ugrep is useful for looking up Emojis 😤, finding obscure symbols ⚸⅗ℏ℞☧☭, or beautiful glyphs to decorate your text. 🙶❡✯🟔❢🙷

You can also use it for the reverse operation to lookup a single character (or a string of them) you've pasted into the terminal.

As a bonus, it can list which fonts are installed that contain a particular unicode character and — through the magic of sixels — will show a rendering in each font.

Installation

It's just a Python 3 shell script. Download it to /usr/local/bin or ~/bin and make it executable.

cd /usr/local/bin
wget https://github.com/hackerb9/ugrep/raw/master/ugrep
chmod +x ugrep

Usage

  • Search by name: ugrep [-w] regex

    Look up a character name where regex is a regular expression. If you don't know regular expressions, don't worry. Just use plain strings and you'll rarely be wrong.

      ugrep runic
    

    If you find ugrep returning too many hits because the phrase you used is found in other terms, e.g., thema found in mathematical, use the -w option to limit the search to complete words.

  • Search by number: ugrep codepoint[..codepoint[..increment]]

    Look up a character (or a range of them) using Unicode code points in hexadecimal. For example,

      ugrep 03c0
      ugrep 23b0..f
      ugrep 0..10ffff..1000
    
  • Search by character: ugrep [-c] character string

    Look up each character in a string. Note that if the string is a single character, e.g., ugrep X, then -c is implied and need not be specified.

      ugrep -c "(゚∀゚)"
    
  • List fonts for a character: ugrep [-l] character

    After showing the usual character information, list installed fonts that contain that character and show an example in each:

      ugrep -l mho
    

    When sshed to another machine, ugrep shows the fonts installed on the remote machine.

  • List fonts, scaled larger: ugrep [-L scale] character

    Same as -l, but scale up the example rendering in each font to be easier to read:

      ugrep -L2 -w om
    

    Useful scale values range from 2 to 8.

Examples

Note: output from all examples has been excerpted. (You'd be amazed how many heart emojis Unicode has. 😜)

<details>

Fun things to try:

To see some useful and lovely glyphs, try this:

ugrep face 
ugrep alchemical 
ugrep ornament
ugrep bullet
ugrep '(vine|bud)'
ugrep vai
ugrep heavy
ugrep drawing
ugrep combining

Plain text search is simple:

    $ ugrep heart
    ☙	U+2619	REVERSED ROTATED FLORAL HEART BULLET
    ❣	U+2763	HEAVY HEART EXCLAMATION MARK ORNAMENT
    ❤	U+2764	HEAVY BLACK HEART
    ⋮	[ ... truncated for brevity ... ]
    💞	U+1F49E REVOLVING HEARTS
    💟	U+1F49F HEART DECORATION
    😍	U+1F60D SMILING FACE WITH HEART-SHAPED EYES
    😻	U+1F63B	SMILING CAT FACE WITH HEART-SHAPED EYES

Paste in a single character to lookup its codepoint:

    $ ugrep ☺
    ☺       U+263A  WHITE SMILING FACE

Arguments on the command line have an implicit wildcard between them:

    $ ugrep right.*gle
    $ ugrep right gle       # Equivalent
    »	U+00BB	RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    ’	U+2019	RIGHT SINGLE QUOTATION MARK
    ∟	U+221F	RIGHT ANGLE
    ⊿	U+22BF	RIGHT TRIANGLE

You can use regular expressions for fancier searches:

    $ ugrep -w '(wo|hu)?m(a|e)ns?'
    ᛗ	U+16D7	RUNIC LETTER MANNAZ MAN M
    ⛀	U+26C0	WHITE DRAUGHTS MAN
    ⛂	U+26C2	BLACK DRAUGHTS MAN
    ⼈	U+2F08	KANGXI RADICAL MAN
    ⼥	U+2F25	KANGXI RADICAL WOMAN
    𝌂	U+1D302	DIGRAM FOR HUMAN EARTH
    𝌄	U+1D304	DIGRAM FOR EARTHLY HUMAN
    🕴	U+1F574	MAN IN BUSINESS SUIT LEVITATING
    🕺	U+1F57A	MAN DANCING
    🚹	U+1F6B9	MENS SYMBOL
    🚺	U+1F6BA	WOMENS SYMBOL
    🤰	U+1F930	PREGNANT WOMAN
    🤵	U+1F935	MAN IN TUXEDO
    
    $ ugrep ^x		    #  Regex anchors ^ and $ work
    ⊻	U+22BB	XOR
    ⌧	U+2327	X IN A RECTANGLE BOX (clear key)

Use the -w flag to search only for complete words:

    $ ugrep -w R	    # The letter R used as a word
    $ ugrep "\bR\b"	    # (regex equivalent)
    R	U+0052	LATIN CAPITAL LETTER R
    Ŗ	U+0156	LATIN CAPITAL LETTER R WITH CEDILLA
    ℛ	U+211B	SCRIPT CAPITAL R (Script r)
    ℜ	U+211C	BLACK-LETTER CAPITAL R (Black-letter r)
    ℝ	U+211D	DOUBLE-STRUCK CAPITAL R (Double-struck r)

Use -c to display info for each character in a string.

    $ ugrep -c "ᕕ( ᐛ )ᕗ"
    ᕕ   U+1555  CANADIAN SYLLABICS FI
    (   U+0028  LEFT PARENTHESIS (opening parenthesis)
        U+0020  SPACE
    ᐛ   U+141B  CANADIAN SYLLABICS NASKAPI WAA
        U+0020  SPACE
    )   U+0029  RIGHT PARENTHESIS (closing parenthesis)
    ᕗ   U+1557  CANADIAN SYLLABICS FO

Aliases (alternate names) are also searched:

    $ ugrep backslash
    \	U+005C	REVERSE SOLIDUS (backslash)

Use .. to browse through a range of Unicode characters:

    $ ugrep 26b3..b
    ⚳	U+26B3	CERES
    ⚴	U+26B4	PALLAS
    ⚵	U+26B5	JUNO
    ⚶	U+26B6	VESTA
    ⚷	U+26B7	CHIRON
    ⚸	U+26B8	BLACK MOON LILITH
    ⚹	U+26B9	SEXTILE
    ⚺	U+26BA	SEMISEXTILE
    ⚻	U+26BB	QUINCUNX

    $ ugrep 1f470..ff  |  less
    👰	U+1F470	BRIDE WITH VEIL
    👱	U+1F471	PERSON WITH BLOND HAIR
    👲	U+1F472	MAN WITH GUA PI MAO
    👳	U+1F473	MAN WITH TURBAN
    👴	U+1F474	OLDER MAN
    👵	U+1F475	OLDER WOMAN
    👶	U+1F476	BABY
    👷	U+1F477	CONSTRUCTION WORKER
    👸	U+1F478	PRINCESS
    👹	U+1F479	JAPANESE OGRE
    👺	U+1F47A	JAPANESE GOBLIN
    👻	U+1F47B	GHOST
    👼	U+1F47C	BABY ANGEL
    👽	U+1F47D	EXTRATERRESTRIAL ALIEN
    ⋮	[ ... truncated for brevity ... ]
    📼	U+1F4FC	VIDEOCASSETTE
    📽	U+1F4FD	FILM PROJECTOR
    📾	U+1F4FE	PORTABLE STEREO
    📿	U+1F4FF	PRAYER BEADS

Sometimes it's useful (or just fun) to page through the Unicode
table and see what characters are defined in a region. (`ugrep
2700..ff`) Ranges are convenient, but very slow. Use regular
expressions if you want speed. (`ugrep U+27..`)

Ranges can have an optional increment:

$ ugrep 0..ffff..1000
   �    U+0000  <control> (null)
   က    U+1000  MYANMAR LETTER KA
  [ ]   U+2000  EN QUAD
  [ ]  U+3000  IDEOGRAPHIC SPACE
   䀀   U+4000  cups; small cups ( M: fàn, C: fan3 fan4 fan6 )
   倀   U+5000  bewildered; rash, wildly ( M: chāng, C: caang1 caang4 coeng1 zaang1, J: KURUU TAORERU, K: CHANG, V: trành )
   怀   U+6000  bosom, breast; carry in bosom ( M: huái, C: waai4 )
   瀀   U+7000  [CJK Unified Ideographs] ( M: yōu, J: ATSUI )
   耀   U+8000  shine, sparkle, dazzle; glory ( M: yào, C: jiu6, J: KAGAYAKU, K: YO )
   退   U+9000  step back, retreat, withdraw ( M: tuì, C: teoi3, J: SHIRIZOKU SHIRIZOKERU, K: THOY, V: thoái )
   ꀀ   U+A000  YI SYLLABLE IT
   뀀   U+B000  Block: [Hangul Syllables]
   쀀   U+C000  Block: [Hangul Syllables]
   퀀   U+D000  Block: [Hangul Syllables]
   �    U+E000  <Private Use, First>
       U+F000  Block: [Private Use Area]
  • Tip: pipe long output to less and search for a code point by pressing /U\+A60F.

Use -l to list which installed fonts contain a certain glyph:

<a href="https://raw.githubusercontent.com/hackerb9/ugrep/master/README.md.d/list-fonts.png"> <img title="ugrep -l swash amp" alt-text="Example of ugrep listing fonts" align="right" src="README.md.d/list-fonts.png" width="50%"> </a>
  ugrep -l swash amp
  • Requires FontConfig. (Most GNU/Linux boxes should already be set).

  • The requested character may also be displayed in each of the listed typefaces, but only if your terminal supports sixel graphics (e.g., xterm -ti vt340) and you have ImageMagick installed.

Use -L to scale up the font examples when listing fonts

<a href="https://raw.githubusercontent.com/hackerb9/ugrep/master/README.md.d/list-fonts-scale.png"> <img title="ugrep -L4 fdfd" alt-text="Example of ugrep listing fonts at 4x scale" src="README.md.d/list-fonts-scale.png" width="100%"> </a>
ugrep -L4 fdfd
   ﷽    U+FDFD  ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM
                  Aldhabi
                  Trutypewriter PolyglOTT
                  Unifont
  • Note that increasing the glyph size also increased the text size. Not all terminals are capable of "double height" text. If yours shows two lines of the same text in the usual size, try using --never-double-text.

Copy whitespace from the terminal

    $ ugrep -w space
	  [ ]   U+0020  SPACE (SP)
	  [ ]   U+00A0  NO-BREAK SPACE (non-breaking space) (NBSP)
	  [ ]   U+1680  OGHAM SPACE MARK
	  [ ]   U+2002  EN SPACE
	  [ ]   U+2003  EM SPACE
	  [ ]   U+2004  THREE-PER-EM SPACE
	  [ ]   U+2005  FOUR-PER-EM SPACE
	  [ ]   U+2006  SIX-PER-EM SPACE
	  [ ]   U+2007  FIGURE SPACE
	  [ ]   U+2008  PUNCTUATION SPACE
	  [ ]   U+2009  THIN SPACE
	  [ ]   U+200A  HAIR SPACE

Whitespace characters are printed with square brackets around them to make it easy to highlight and copy them from the terminal. They will also be shown with a yellow background, if the terminal allows.

Determine if an alias is actually a correction

Ugrep shows the character name in all caps and aliases are usually lowercase in parentheses. Some aliases are treated differently. For aesthetic reasons, abbreviations are also shown in uppercase. For example:

<span style="font-family: monospace"> � U+FEFF ZERO WIDTH NO-BREAK SPACE (byte ord

Related Skills

View on GitHub
GitHub Stars18
CategoryData
Updated3mo ago
Forks2

Languages

Python

Security Score

92/100

Audited on Dec 3, 2025

No findings