grep ' [^$] ' /etc/passwd
It is a bit tricky question
, So first read it carefully
^ Represents the beginning of the line,
sanjay ~> grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash
$ Represents the end of the line.
sanjay ~> grep :$ /etc/passwd
news:x:9:13:news:/var/spool/news:
[ ] (Brackets) = match any one of the enclosed characters, as in [aeiou]. Use Hyphen "-" for a range, as in [0-9].
[^ ] = match any one character except those enclosed in [ ], as in [^0-9].
grep '^$' files {search for blank lines}
Now you got what it for searching if you will givegrep ' [^$] ' /etc/passwd
~~~~Sanjay~~~