delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

How can use grep to do that. I don't know how grep works I tried but it did not work
Thanks


Hi,
I have directory, with folders and then those folders have further subfolders. I have a file that have a text
Exchange - changes to NASDAQ
I need to find the file that has that?
How can use grep to do that. I don't know how grep works I tried but it did not work
Thanks

TOP

assuming you're in the target directory
Code:
  1. grep -r "Exchange - changes to NASDAQ" ./*
Copy Code
But it has to be that text EXACTLY that string, caps included. If you want case-insensitivity add a -i
grep is incredibly powerful and useful when you use regular expressions, and learning how to use them is highly reccommended. Damn near anything you can do on *nix can benefit for regexps.

TOP

Looks like someone beat me to it. However, one more word for you. I also suggest getting used to working with man pages. These are manuals on the different commands, applications, and even development resources available. To bring up a man page on grep, type in the following at the prompt.
Code:
  1. man grep
Copy Code
You will see a full screen page in your shell describing the grep syntax. When I have more time I might put together a complete tutorial on how to interpret man pages. However, an excellent way to learn how man works is:
Code:
  1. man man
Copy Code




How can use grep to do that. I don't know how grep works I tried but it did not work
Thanks

TOP

Back Forum