If you know the folder the file is in, but you don't know which file, use:
find /path/to/folder -type f | grep blabla
where /path/to/folder is the directory path to the folder.
If you don't know the folder, but you know the top level directory, use:
find /<top level directory> -type f | grep blabla
where <top level directory> is the name of the top level directory.
If you have no idea where in the system the file is located, use:
find / -type f | grep blabla
where / means start searching from the root of the filesystem and search the entire filesystem.
If you know the name of the file the 41 lines are in but you don't know where the file is located, you don't need grep; you need find.
find / -type f -name <filename>
to search from the root of the filesystem for the file name you want.
If you want to specify that it must be 41 lines, you will have to write a script to include some decision making algorithm to filter out all files that don't have the search expression in 41 lines.
Last edited by bigrigdriver; 02-19-2008 at 10:36 AM.
|