Re: Using grep to find a string containing stars

From: Bit Twister (BitTwister_at_mouse-potato.com)
Date: 11/25/05


Date: Fri, 25 Nov 2005 08:15:09 -0600

On Fri, 25 Nov 2005 14:00:15 +0100, Matthieu Gaillet wrote:
>
> I encounter some difficulties finding the string "***" using the command
> grep under Sun's Unix Interactive (pure vintage)
>
> it seems that the star is acting as a wildcard...
>
> example : the command grep "***" file.txt reports ALL the lines of the file.
>
>
> Any comments/advice on this ?

Use the escape character to prevent expansion by the shell. On linux

grep "\*\*\*" file.txt



Relevant Pages