When i use the command above, i get wrong matches.....can someone explain me, what is wrong?
I'm trying to search for the string "..." in all files in the current folder.
|
As Andy White said, you have to use So you have to write (
or if you still want to use grep :
And if you only want the current directory and not its subdirs :
|
|||||
|
'.' matches any character, so you'll be finding all lines that contain 3 or more characters. You can either escape the dots, like this:
Or you can use fgrep, which does a literal match instead of a regex match:
(Some versions of grep also accept a -F flag which makes them behave like fgrep.) |
|||
|
If you are literally typing Please post more info on what you're searching for, and maybe someone can help you out more. |
|||
|
If you're looking for a filename that matches, try:
or
If your looking for looking for files that match (ie it contains the grep string)
works fine. or simply:
|
|||
|
To complete Jeremy's answer, you may also want to try
or
Which is similar to a xargs I might add : RTFM ! Or in a more polite way : use & abuse of
! |
|||||||||||||
|