0

I need to look for &amount in a file but it throws error -

[1] 25950
amount: Command not found.
Usage: grep [OPTION]... PATTERN [FILE]...

What is the right way to search for it?

R11G
  • 103

1 Answers1

3

Put it in quotes like

grep '&amount' file

so the & isn't interpreted by the shell to put the grep in the background and then try to run the command amount

or alternately, you could escape it so it won't have the special meaning to the shell:

grep \&amount file
Eric Renouf
  • 18,431