Open Source Research and Development

Free and Open Source R&D Projects, Articles, and Reviews

how do i grep on a term with a $ in it such as $foo? i tried enclosing it in quotes but that doesn’t help

Enclose the $ in square brackets [ .. ], that is, specify the special character as a character class. For example,

grep ‘[$]foo’ file.txt

Leave comment

Your email address will not be published. Required fields are marked with *.