LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
imput


hello!
#
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
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 PM.

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