I have some problems with the grep command. I have the following two files in my folder:
test.dat:
fdf
bla(fd_bla_bla) =&
bdf bla
test2.dat
fd
fd
fij
d
bla(fdf)
fdjk
bla
Now I search for the bla having brackets after it with
grep 'bla(*)' *
but it just gives me the entry of the first file...Do you have an idea why?
grep -F "bla("
This will tell grep to use special characters as a regular (Fixed) string.
You need regular expressions to do that match.
egrep "bla\(.*\)" *.dat
will give the correct result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With