General :: Search Multiple Words In Multiple Lines?

Dec 16, 2010

How to search multiple words in multiple lines, inside a directory including sub-directory? Pls. give easy example. I want to search the files (in /xx folder and all subfolders) that have header.h included and used x() function. I tried $grep -r "header.h" | grep -r "x(" /Folder/subfolder/ > search.log

View 7 Replies


ADVERTISEMENT

Ubuntu :: Use Multiple Words / Terms (boolean AND) With Gnome Search Tool

May 27, 2010

I just want to search file names, not their content.

Using gnome-search-tool, if I search for "word1 word3" I can't find "word1 word2 word3.txt" but I do find it (and too many others) if I just search for "word1"

I would have thought a boolean AND search would just be automatic, but I guess not. I've already come across searchmonkey, but I'm not smart enough to figure out how to set it up to do this - i.e. I don't want to have to use regular expressions or be typing "*" all over the place.

P.S. I do use google desktop search, but I hate using it as the results are way too narrow to be of any use and haven't been able to figure out how to widen it.

P.P.S. I also found this: In terminal type gconf-editor and find gnome-search-tool in the Apps. Then look for the field quick_search_second_scan_excluded_paths and change the slash to nothing, i.e. delete the "/".

It worked for my ubuntu 10.04 pc, but not this one (ubuntu 9.1) - so I thought maybe there's another way...

View 5 Replies View Related

Ubuntu :: Replace Multiple Lines In Multiple Files?

Aug 20, 2011

I often use the rpl command to make changes to multiple html files at once. For example:

rpl -R '<br />' '<br /><br />' mydirectory However, I haven't been able to figure out how to change multiple lines. For example, let's say I want to change all occurrences of :

<br />
<br />
to:
<br />
I've tried
rpl -R '<br />
<br />' '<br />' mydirectory

but that didn't work. how to do this with rpl or some other way?

View 9 Replies View Related

OpenSUSE :: Web - Screen Loads And After Initial First Few Lines Breaks Up Into Multiple Repetitions Of Lines

Apr 22, 2011

I have been experiencing a problem where the screen loads and after initial first few lines breaks up into multiple repetitions of lines. Reloading helps but has to be repeated when pageing down. Mail is no problem; it is supplied by my network provider. OS is openSUSE 11.2 which I update when advised. Below is a sample from the error console:

[Code]...

View 1 Replies View Related

General :: Vim: Tab-align Multiple Lines?

Apr 14, 2010

In GUI style editors, you can generally select multiple lines, press tab a few times to move all the lines across (or shift-tab to go back). I have no idea how to do this in VIM.I googled around and couldn't find any straight answer to I came here.

View 2 Replies View Related

General :: Advance Sed To Remove Multiple Lines

May 12, 2010

I have a txt file with couple of comment lines:
Number of title = !num!
#line1
#line2
#line3

I wrote a script with "sed" to replace !num! in this file, which is very straightforward. However, based on the !num!, I want to remove the number of "#" based on the !num! value. Is there an easy way to do that with "sed"; otherwise, i will have to write a script to loop through the file.

View 8 Replies View Related

General :: Multiple Lines At The Command Line?

Feb 22, 2011

I've seen a few tutorials that have commands and parameters on multiple line, like the one below:

Code:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

I can copy and paste this in Putty, but what if I want to manually type it? If I press return, the first line gets processed, so how do I insert a new line?

View 4 Replies View Related

General :: Use Grep To Match Multiple Lines?

Feb 3, 2011

I have done this before but i cant really recall now

I have a text file and i want to grep the word "interface" and 10 lines following it. I think there was some switch like grep -A or something ?

View 2 Replies View Related

General :: Use Grep To Search For Multiple Options?

May 20, 2010

How can I use grep to search for line with either 'res' or 'rep'? i try "grep -e res|rep" or gre -e "rep|rep" but that does not work.

View 3 Replies View Related

General :: Grep Multiple Lines From A Text File

Jun 17, 2009

I have a list of words that I want to grep in many files to see which ones have it and which ones dont. in the text file I have all the words listed line by line, ex: list.txt:

check
try this
word1
word2
open space
list ..

I want to grep each line one by one. like I want it to

grep "check" *.log
grep "try this" *.log
grep "word1" *.log .. etc how can I do this?

and maybe write the output to a file.

View 5 Replies View Related

General :: Script To Append Lines To Multiple Files?

Aug 22, 2009

eed to make a script to append a line to the bottom of multiple files (only certain files, but 100's spread over directories).Doing a find replace inside multiple files is easy, I use the followingfind /base/dir -name "*.txt" -exec perl -pi -w -e 's/FIND/REPLACE/g;' {} ;So I tried doing the followingfind /base/dir -name "*.txt" -exec echo "Append this" >> {} ;However this just appends all the text into a file called "{}". Whereas {} should be replaced with each file that's found.

View 1 Replies View Related

General :: Search For Text Strings In Multiple PHP Files?

Feb 3, 2011

Long story short, I got a folder with nearly 800,000 php files. I would like to search each file for a string and if it exists in that file, the file gets copied to another directory. Is this possible from the terminal? So far I got: grep -i -n -r 'ppr-1792' * | cp $1 move_to_here

But this obviously doesn't work. $1 needs to be the file name that contains matching text.

View 2 Replies View Related

General :: Search For A File In Multiple Machines Simultaniously?

Sep 15, 2010

Im new to the forum and fairly new to Linux as well. my apologies if this is posted in the wrong section. My problem is How can you search for a file in multiple machines (like a server farm) ? For example i log onto machine num1 and want to search for a file named "xxx.yyy" which may be in one of 4 machnies. What i do right now is manually log into each machine and run the find command. However i have heard that it is possible to do it via a couple of simple commands. I have looked into pssh and cssh as well as ssh tunneling (along with public key authentication to stop the machines requesting a password every time i log in) and unfortunately i was unable to find an answer.

View 4 Replies View Related

General :: Search And Replace Line In Multiple Files?

Jul 13, 2010

Hello, I need some help searching through multiple files, finding a line and replacing that line. The line I am searching for is:

password key ******* 1222554

ultimately I want to be able to delete the numbers after the asterisks . my thoughts are to create a script that will search for the line password key ******* and delete it then replace it with password key ******* my files are located in /opt and they are all txt files.

View 13 Replies View Related

General :: Shortcut To Remove First Character Of Multiple Lines In Gedit

Jan 23, 2010

I want to be able to remove the first character of a line when I highlight multiple lines in gedit. Example:

%Example is
%Commented Code
%Uncomment using this shortcut

I would then highlight/select these lines, and remove the first character to make it look like this:

Example is
Commented Code
Uncomment using this shortcut

I'm pretty sure there is an actual shortcut for this. If there is another text editor on Linux that it would work in, it would be nice to know how to do it in that editor as well.

View 2 Replies View Related

General :: Emacs - Search And Replace Regex In Multiple Buffers?

Apr 7, 2009

I'm fairly comfortable with emacs but I can't seem to find how to do this. I deal with a lot of text files and find myself performing a lot of regular expression replacements to correct the formatting of the text -- or to extract certain tidbits of data from large ugly-looking files.

I know how to perform a regular expression replacement in one buffer at a time. But how do you perform a regular expression search and replace across all open buffers? I have found a method to perform a regex search and replace across a directory by marking files but I need to do it in the open buffers.

View 2 Replies View Related

General :: Search And Replace String Having Multiple Special Characters

Aug 26, 2009

Below is extract of my file:

What I need is to replace "--destination-path=" with "--destination-path=/home/dest"

i.e. desired output is ----destination-path=/home/dest

I could achieve it with below command

$cat outgoing-xfer|grep destination-path|perl -pi -e "s/destination-path=/destination-path=/home/dest/g"

But the problem is that in this case i just wanted to append "/home/dest" for which I could easily escape "/" with just two "", but I wonder if i have a long path like "/a/b/c/d/e/f/g/h/i/j" I will have to escape so many /. Is there any other way by which I can avoid escaping forward slash.

I tried following:

But receiving follo error

Bareword found where operator expected at -e line 1, near "s/destination-path=/'destination-path=/home"
syntax error at -e line 1, near "s/destination-path=/'destination-path=/home"
Bad name after dest' at -e line 1. tried with enclosing in double quotes as well but in vain

View 5 Replies View Related

Ubuntu :: Having OpenOffice Replace Multiple Words Simultaneously

Apr 27, 2011

I have a list of approximately 50 words that I'd like to search documents for and delete those words. I was wondering if there is some type of automated process for removing multiple words rather than me manually putting each word into 'find and replace'

On that note I guess I could write the Macro in python if there isn't anything out there that does this. However I read that open office only works with python 2.3.5 or something of that nature, and I have already installed 3.1. Is that still going to be an issue?

View 2 Replies View Related

OpenSUSE :: Words Unexpectedly Disappear When Typing (in Multiple Applications)

Jul 15, 2010

I have trouble when typing in Open Office Writer, Kmail, and zim, among other applications. It's not due to unintentional use of the 'insert' key, either.When I type in these applications, the word I am typing often disappears entirely if I don't add a space, return, or punctuation at the end of the word, or use the arrow keys. For example, when setting up a profile in Kmail, I typed my email address into the settings dialog box, and it kept removing the last part of the address: "myname@univ.edu" would always become "myname@univ." unless I added a space after the edu.

When I first encountered this behavior, in Writer, I thought it was a bug with the AutoComplete feature. But now that I've seen it in other applications, I think it is something more general. how to stop the unexpectedly deletion of words while typing?

View 3 Replies View Related

General :: Create A Single Line Of Output From Multiple Variable Lines Of Input

Feb 3, 2010

I need to create a single line of output from multiple and variable lines of input in a Linux bash shell script.

My input file looks like this:

Where there may be any number of umsecondaryphonenumber lines; if there is not a umsecondaryphonenumber line for a telephonenumber, I don't want to write any output.

So, the output file should look like:

The script I have so far is:

My question is - how do print each of the elements of an array in one record - i.e. what do I put in place of howdoiprintarray?

View 2 Replies View Related

General :: Copy Lines Starting And Ending With Specific Pattern From Multiple Files To A File?

Jul 27, 2011

A function by name abc is called in many files. I want to copy all the lines with the function call to an output file.A simple grep on function name doesn't help me as the function call is spanning across multiple lines as follows:

abc(parameter1,
parameter2,
parameter3);

So I want to copy all the three lines (till semicolon) to the output file.The problem is because there are more than 200 calls for the same function and I cannot do it manually

View 2 Replies View Related

General :: Use 'iw' To Create Multiple Virtual Interfaces To Connect To Multiple Networks?

Oct 26, 2010

I'm trying to connect one computer to two others in an ad-hoc infrastructure.

[computer 1] ---- [computer 2] ---- [computer 3]

computer 2 is running Linux and has a single NIC wlan0. I want to it to connect to both computer 1 and computer 3 so each computer can talk to the other. No switch is available so it needs to be an ad-hoc setup.

[Code]...

View 1 Replies View Related

General :: Rename Multiple Files In Multiple Directories/subdirectories Recursively?

Aug 23, 2010

I am to rename all the files within a directory (which contains multiple subdirectories) recursively without invalid characters.

I tried the coding posted above.

find . -type f -printf '%p
' | while read file; do
oldfile=$(basename "$file")
newfile=$(echo "$oldfile" | sed 's/[^A-Za-z0-9_.]/_/g')
if [ ! "$newfile" == "$oldfile" ]; then
echo mv "$file" "${file%$oldfile}$newfile"
code....

but I get an error on both of them stating "find: bad option -printf find: [-H | -L] path-list predicate-list"

View 9 Replies View Related

General :: Good Support To Multiple Desktops AND Multiple Monitors

Jun 4, 2010

I'm starting to have A LOT of opened windows in my machine. Sometimes within a project, I have e-mail/task management/personal e-mail/twitter, and a lot of different opened applications/terminals in my Linux workstation.Sometimes it would be interesting to have different workspaces to projects instead of this configuration I have nowadays that are classes of work (bad name, I know, but I think you got the idea).I'm starting to think about using two monitors: one with Corporate Management, Work and Personal. The second monitor is only the development state: each workspace here is about a project being worked on instead of groups of works like before. A workspace may be implementing different classes for example.

My question is: I just want to change to a second monitor using the mouse. I want to still be able to change workspaces in the same monitor using keyboard shortcuts. The keyboard shortcuts wouldn't change monitors, just worskpaces on the same monitor. All the tutorials I read (like this one) only tells how to use multiple monitors but doesn't answer my question about keyboard shortcuts.Does Linux (Ubuntu 10.04 Lucid Lynx or Debian 5.0.5 Lenny) support this envisioned setup (Different workspaces in a way that keyboard workspace switching only works in the current monitor) ? If so, how?I haven't tested this setup, that's why I'm asking. In this question the user says it works exactly how I want it to behave, can someone else confirm it?

View 3 Replies View Related

General :: Multiple Servers Or One Server With Multiple VMWare?

Feb 7, 2011

I'm looking at setting up a couple automated systems: Here are a few examples:

* Internal accounting system to download and process emails
* Public web server to visit

I could put each system on its own separate box -- for example, it's generally good practice to separate anything that external users have access to (such as a webserver) from internal processes such as accounting. Now, rather than dishing out the money for two separate servers, could I get away with just installing new instances of VMWare on the same box for each system?

To give you an idea, these are not large scale computationally sensitive systems. The accounting one is simply downloading and tallying emails, and the latter is just a webserver with maybe 5 hits per day on a good day. I could definitely pick up a new box for say $50, but I wanted to know the general practice of using VMWare on the same box versus two separate boxes.

View 2 Replies View Related

General :: Count Lines And Words?

Feb 15, 2010

How can I display the no. of lines, words and characters for each file in current directory and in sub directory.

wc . * shows errornous result as there are some executable files in that directory.

View 2 Replies View Related

OpenSUSE Network :: Actually Bond Multiple DSL Lines Together?

May 18, 2011

I'm familiar with load balancing.. but Is it possible to actually bond multiple DSL lines together? I hear of ways to bond using MLPPP but that requires support from an ISP. Is there a way to actually bond without support from my ISP, or use say a cable modem and a DSL line together for faster speed / diversity?

View 2 Replies View Related

Programming :: Inserting Multiple Lines - With Newline - Using Sed Or Awk

Mar 8, 2009

I need to replace part of a line in a file with multiple lines, however need to separate each line with a newline is this possible?

Example, need to remove line 2

And insert line similar to below:

If the multiple lines were part of a text file, would inserting a text file automatically include newline characters?

View 1 Replies View Related

OpenSUSE :: Search Through Multiple PDFs In KDE Without Acroread?

May 30, 2011

Is it possible to do the following without using the Adobe reader?Adobe Reader (acroread) has a nice search feature that allows to search for strings inside all .pdf files in certain directories (e.g. show me all lines containing the word "recursion" in all PDF files in or below directory "/papers", which gives you a neat clickable list and the sentence for each hit).I much prefer Okular for viewing PDFs, but I am at a loss on how to duplicate the above feature without acroread under linux. The KDE FindFile apparently does not search inside PDFs, or at least not in an intelligible way. I do have Nepomuk running, hogging resources, but I don't understand how to query it - if this is possible at all. So what can I do besides using acroread?

View 1 Replies View Related

Ubuntu :: Search For Term In Multiple Files?

Mar 7, 2011

I am trying to search for a term in a bunch of files. Is there a way to do this. I would like to search all the files in a directory and its subdirectories for a specific term.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved