grep for forward slash

How can I use grep to grab a line that contains a forward slash? I've tried:

grep "/pd " file,

Inevitably it just grabs pd not /pd.

grep "/" file

well I need to grep using the string I supplied in the initial post. I'm searching for a string called pd with a space after it. So I need to grep "/pd ". Parentheses alone don't work.

try
grep -- "/pb"
or use fgrep.

1 Like