General :: Ubuntu - Search Text In Files And Display File Name?
Mar 30, 2011
I am using find some_dir -name "*.some_ext" | xargs -l10 grep "some_expr"
to find files in folder, but I just want to display the file name but not all file content. Any solution?
View 2 Replies
ADVERTISEMENT
Apr 21, 2010
Currently, when I'm searching text in files of my PHP project, I use this line :
Code:
grep -r 'myTextToFind' *
But now, I would like to search only in ".lang" files. How can I do that ?
View 7 Replies
View Related
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
Sep 3, 2010
how to search in files text that is one-byte encoding? places - search for files in gnome in ubuntu searches only utf-8 text.i know one way: install wine and total commander, then search with it. what are better ways?[URL]
View 4 Replies
View Related
Jan 18, 2011
How do I recursively generate a text file which has a list of all files on my server which contain a specific string anywhere in the files?
I know the following command can be used to replace a string recursively
find /var/www -type f -print0 | xargs -0 sed -i 's/old string/new string/g'
I do not want to replace the string, I just want a list of all files which contain the string.
View 4 Replies
View Related
Aug 2, 2011
I have a file called Regions.ini that looks like this:
Code:
[Granite]
RegionUUID = 54ab7cd2-0e70-49b7-8020-8dbeb84c08d0
Location = 9991,10007
InternalAddress = 0.0.0.0
InternalPort = 9001
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9
[Syenite]
RegionUUID = 8fc56fdd-0afd-4074-9432-0ae8f42b799f
Location = 9992,10007
InternalAddress = 0.0.0.0
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9
What I need to do is find out what the IP address is after "ExternalHostName ="
After that I will need to compare that IP to whatismyip and if it's different then replace it but that is easy to do with sed. I just can't figure this simple hurdle out.
View 12 Replies
View Related
Nov 23, 2010
I've got a big text file in which I know have probably made some typos (LaTeX). Sometimes I rewrite sentences several times and then end up with double pieces like "the the" or "is is" without noticing it. Most spell checkers that I can use in LaTeX are very basic so they do not notice these grammar errors. Is there a way that I can search for these repetitions by hand using sed or awk or something along these lines? Is there an app for that?
View 3 Replies
View Related
Feb 3, 2011
Suppose I have a pair of files containing lists. The first file is called contigs.txt and it contains a list that looks like this:
Code:
Contig822
Contig826
[code]...
View 5 Replies
View Related
Jan 19, 2010
I need to search a text file for a string of numbers which are different lengths, and always are between number=" and " like:
number="1234567890"
number="22390"
I need to grab those numbers and pipe each one to a line in a file. I've already tried something with awk and that didn't seem to work.
View 10 Replies
View Related
Mar 6, 2010
I have a hidden folder with a lot of text files in it. I would like to search in this folder for all files containing a given text.The File Browser's" FIND searches only in the file names, not in their contents.The FIND function of Ubuntu does not allow me to search ONLY in the given hidden folder. So, how can I find my files within the hidden folder with the given text within them?
View 7 Replies
View Related
Apr 21, 2010
Running SunGard Banner software on RHEL 4.2 x86-32 bit Linux server Oracle Application 10.1.2.3 samba enabled. Users run processes/reports that are logged in a daily log file. In our daily job submission log files the user password shows up as clear text.The password shows up as $PSWD (sample from the logfile):
$JOB
$BANUID
$PSWD
[code]...
View 1 Replies
View Related
Jun 23, 2011
Im trying to read a file in c++ and search for particular character for example if this is a list that I have:
Alice
Bob
David
[code]....
if the input is D, it should give David, if its B, gives bob. so in this case, meaning it reads the first character of every line. but if possible I want to make this dynamic so the user can specify which character position he is looking for, so in case he is looking for R as character index 3 in all lines, it should give Charlie. but the problem is, it does now recognize , besides, I do not know how to specify the character position in each line.
here is my code
Code:
#include <iostream>
#include <fstream>
#include <cstring>
[code]....
View 1 Replies
View Related
Jan 25, 2010
im tryin to make a tool in visual C++ which will take an input string through a text box,then it will compare tht string with a text file containing data and display the matched results in list box.
View 2 Replies
View Related
Jan 3, 2011
What's the easiest way to search for a string in a text file in GNOME or on the console? I used to do this in kfindfile back on KDE.I'd like to avoid downloading something like desktop search if at all possible because I'm away for the holidays and stuck on a dialup connection.
View 5 Replies
View Related
Oct 16, 2010
As indicated in the subject, I want to search a text. If the text is present I want to replace it. But if the text is not present, I want to insert it after first line and before last line.
Searched text is:CleanCache "*";
Where * can be anything.
Example: CleanCache "false"; -> CleanCache "true";
If CleanCache "false"; is not present, only insert CleanCache "true"; after first line and before last line.
View 8 Replies
View Related
Jul 16, 2010
Something very handy to do in a Linux shell, is manipulating files and strings - essentially parsing data. Write a utility which will scan in a text file and search and replace strings. We also want to keep track of how many strings we've replaced.
I know that my command would look like this: <utility name> <filename> <stringToSearchFor> <stringToReplaceWith>
Code: #!/bin/bash
[code]....
View 2 Replies
View Related
Feb 23, 2010
This should be simple but I can't seem to find what I am looking for.I want to search a text file for the existence of certain strings and execute a command if they exist, something along the lines of:
if <string> exists
command
or
if <any member of this list exists>
command
I know how to manually search a file with grep, cat, etc., but the "if this exists" part eludes me.
View 7 Replies
View Related
Jun 1, 2010
Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.
View 4 Replies
View Related
May 29, 2011
i have the following text in a file located in /home/anoopm101/.task [description:"this is the text" entry:"1306682734" status:"pending" uuid:"25c54e1b-824f-52bc-4933-dfe7cda34bc7"]
i have to display on my desktop "this is the text" using conky.
View 2 Replies
View Related
May 29, 2011
i have the following text in a file located in /home/anoopm101/.task
[description:"this is the text" entry:"1306682734" status:"pending" uuid:"25c54e1b-824f-52bc-4933-dfe7cda34bc7"]
i have to display on my desktop "this is the text" using conky
View 7 Replies
View Related
May 19, 2011
What would be the best way to search for a file that contains a string similar to this:
View 1 Replies
View Related
Sep 14, 2010
I've found these commands in [URL]:
Quote:
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt
But I don't understand these commands, even after reading their manuals.
View 4 Replies
View Related
Oct 9, 2009
I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.
Here's the Script:
#Here's where the problem is that I know of
I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.
View 6 Replies
View Related
Sep 17, 2009
Im trying to compare two files and I only want to display the user names that are in the first file and not the second.
So I have one file named final.txt (which contains every user name and only the user names in a list no other information)
Then I have another file Over1.txt (which only contains certain users that have different permissions This file is also setup differently with the user name and some information about the user after the user name.
I need a way to compare final.txt to over1.txt so that I will only display the names that are in final.txt but not Over1.txt
Ive tried using diff and comm but just cant seem to get it two work correctly. Im not sure if im missing a option or what.
View 5 Replies
View Related
Nov 28, 2010
I need to search for a string "teststring" in all *.java files coming under /home/user1/ (including subfolders). How can I do it in linux via shell command.
View 5 Replies
View Related
Jul 12, 2011
I have a html page and I would like to search for the occurance of a given string as an anchor. Then I would like to search backward for a the first match to a given regular expression. As a result I would like to output the text between the two points.
Please note that I would like to have the output up to the first regex match before the ANCHOR point.What is the best tool to solve this?
View 1 Replies
View Related
Sep 17, 2010
I have done a bunch of searches on this but the terms seem to get tangled in the more popular search of "colouring the output of grep / awk". I am trying to find a way to grep/awk through the output of a command to find text of a specific colour. The command's output has a range of colours signifying too many different things to specify using text, with colour being the only form of grouping.
View 5 Replies
View Related
Dec 26, 2009
Im trying to figure out how to display parts of a .db file created by the scorch2000 server to display a player name, games played, score and maybe more...
here is the text file format example:
playername1 password email #ofgames score setting1 setting2 setting3
playername2 password email #ofgames score setting1 setting2 setting3
playername3 password email #ofgames score setting1 setting2 setting3
playername4 password email #ofgames score setting1 setting2 setting3
playername5 password email #ofgames score setting1 setting2 setting3
I dont want to display everything, of course ^^, but how do i get the player name, the number of games he played and his score to display it in a webpage in this fasion:
Name Games Played Score
joe blow1 25 9876890
joe blow2 31 8989767
joe blow2 26 7989767
joe blow2 17 5989767
joe blow2 13 4989767
and by highest score because the log doesin't put them in in score order....
please help, i asked the maker because he has one runing already but no answer back, well the game is pretty old so i didn't really expect an answer anyways and tryed to figure it out but i dont know functions in php, this is to include in a php-nuke block (this i know how to do
here is an example of a working page at the developper website:url
View 14 Replies
View Related
Feb 24, 2010
I want to search a file for a particular pattern and if pattern found replace the line with new text. i am using awk 'match($0,"pattern") != 0 {print $0} ' filename to check if the pattern exists.how do i get the line number of the pattern and delete that line and replace the line with my new text?
View 1 Replies
View Related
Oct 26, 2010
I want to search for all files on my server that end in a couple of differnet filenames, and then have the location of them sent to a file.
What is the best way to achieve this.
View 1 Replies
View Related