Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-19-2008, 06:17 AM   #1
LQ Newbie
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0

i m looking for the right imput to search for a data file containing „blabla“ with 41 lines containing this string in every 41 lines.

grep (missing imput??) "^blabla"
please help me

a noob
Old 02-19-2008, 10:29 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,894

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need your imput on a new video card... g_2 Linux - Hardware 3 04-03-2004 10:13 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration