Is grep broken, or am I broken?
I cannot upload an image so I'll just write the output and commands.
Command:
$ grep [Joes5] resturants.txt
output:
smart, Parks, seafood, 6834948,9
italian,Bardellis,pizza,6973434,5
steakhouse,Nelson Eye,Grill,6361017,8
steakhouse,Buchers,Grill,6741326,7
smart,Joes,seafood,6781234,5
Command:
$ grep *,5 resturants.txt
output: nothing
$ grep * resturants.txt
output: again, nothing
$ grep Joes5 resturants.txt
output: nothing
command:
$ grep 5 resturants.txt
output:
italian,Bardellis,pizza,6973434,5
snart,Joes,seafood,6781234,5
I encountered the same problem with debian, which is the main reason I decided to try out fedora instead. I consulted this problem with my linux teacher, and he couldn't figure this out either. PS: I updated my system today. I haven't used grep for a while now, so it may lie in some new version of /etc/grep.
So the question is: Am I doing overlooking some basics? Is grep not taking multiple patterns (*)? or is grep supposed to act like this?
PPS: the color scheme in fedora shows that the output findings comes from characters, as if I was searching for certain letters, not a certain pattern.
edit: It's mostly these commands that I'm worried about:
$ grep *,5 resturants.txt
$ grep * resturants.txt
they do not output anything.
Welcome to ask.fedora. You might want to run
unalias grep
to get rid of the distracting colors that the fedora devs assume everybody wants. Also, you might want to runwhich grep
to find out where the binary actually is. (hint: it's not in /etc) It would also help if you'd edit your post to add some formatting, as it's hard to see just what's happening right now.+1 for that, please format your post a little bit so it's more readable. I really can't figure out what is going on with current formating ;-)
Good that you formatted this better. Bottom line, grep was working and continues to work. You need to look more carefully at your usage to understand that it was/is working correctly.