Ubuntu :: Finding Words In File?
Apr 28, 2011Is there a command that could be used to find word content in a file? I.e I want to find all files containing the word 169.254.0.0 in /etc directory.
View 4 RepliesIs there a command that could be used to find word content in a file? I.e I want to find all files containing the word 169.254.0.0 in /etc directory.
View 4 RepliesI am looking for this `struct messages_sdd_t` and I need to search through a lot of *.c files to find it.However, I can't seen to find a match as I want to exclude all the words 'struct' and 'messages_sdd_t'. As I want to search on this only 'struct messages_sdd_t' The reason for this is, as struct is used many times and I keep getting pages or search results.The directory I am searching in, has another directories so it will have to search recursively.I have been doing this without success:Code: find . -type f -name '*.c' | xargs grep 'struct messages_sdd_t'and thisCode: find . -type f -name '*.c' | xargs egrep -w 'struct|messages_sdd_t'
View 3 Replies View RelatedI want to find and remove duplicate consecutive words from a text file. I've tried working with array but is very difficult..then i've tried using sed...somebody hint me with this sed :
sed ':f;N;$!bf; s/(.*)
1/1
/g; s/(.*)1/1/g'.
It works fine but if i have 3 consecutive identical words it only remove first one and the last two remain intact.
Is there a Linux program I can use to display random words from a list? By entering words in a spreadsheet and then sorting the list in alphabetical order, I made a list of new vocabulary words for myself to memorize, and wondered whether I could make random words from the list display on the screen daily. I know I could write a program to do that if I knew programming, but I don't.
View 10 Replies View RelatedI have been messing with diff and grep for 2 days now without result
I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.
What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn
setup:
Each of em are plain text files with 1 word per line
Output should be something like:
SCRIPT REPORT:
i waas wondering if anyone knew of a script or program that removes duplicate words in a txt file. im making an install script and the install list has gotten a bit long so i want to ensure there are no duplicates in the file
View 2 Replies View Relatedi have this file, and considering it's obnoxiously huge i'd prefer not to have to do this manually. Is there some way i can manipulate sed or awk to change every other letter in all the words in a file to capital letters?
View 7 Replies View RelatedI am using Oracle Enterprise Linux version 4 update 7.
Sometimes I have to access large files with thousands of lines in them and I would like to locate a particultar word. e.g.
vi /etc/passwd.
The contents of file passwd are displayed.I want to find a username of joe assuming the passwd file is 2000 lines long.
I would like to use a linux command that will locate joe and highlight in the passwd file as to where word joe is.
Is there a linux command that can do this?
I exported a spreadsheet file into cvs format.
The cvs file is formatted this way
field1,field2,field3,..etc
I want it to be in a Quote delimited format like so
"field1","field2","field3",..etc
I tried Suse five or six years ago and ran into an issue that was not comfortable to work with so I went back to windows. The problem was open spaces between words was not permitted with my music files. I have transferred all of my CDs and LPs to MP3 and have a tremendous number of them and the Suse of five years ago required I convert a title like Foggy Mountain Special.mp3 into something resembling Foggy_Mountain_Special.mp3
I don't care to convert literally a hundred thousand titles to fit the latter format. Does the current version of Suse allow the use of spaces between the words or is the 'no open space' convention still required?
i want to remove words "Max" and "constrained" in a file given below:
Max 0.003745 constrained
Max 0.004549 constrained
Max 0.001689 constrained
[code]....
and further want to replace "Max" by line number so that i can plot the resulting file. i searched in forum, but couldn't do what i wanted to do. e.g. i used
1)grep command
grep -v "Max" inputfile >outputfile
deletes whole line,and hence whole text.
2) sed command
cat inputfile |sed 's/ .{1,12} //g' >outputfile
gives output
0.003745constrained
0.004549constrained
0.001689constrained
[code]....
I am trying to use grep to only tell me files that include both words matching in a pattern file. However when i specify:
grep -f <pattern file> <file>
It pulls out anything that matches one or the other.
Not both.
how to get it to match AND not OR.
I am basically trying to remove duplicate words in my <title></title> tag after I got hit by Google Panda. I have around 750 .html files and it will be difficult for to me remove one by one. I am looking for a way to remove only from within <title> </title>
Example of a duplicate title I have:
Code:
<title>Pasta, Pasta Recipe and Pasta Guide</title>
I dont want to replace those words anywhere else in the file except for within the <title>
I have a text file that gets produced at the end of the script being run.
For this example the text file will produce the following:
Quote:
THE COW
THE DOG
THE CAT
THE HORSE
In the script I am using either echo or printf to print on the screen each line and then it is doing a test and produces a good or bad result.
Another example:
Quote:
THE COW -- IS HOME
THE DOG -- IS HOME
Each whitespace between the -- are 5 spaces. How can I get them to be in-line and formatted when it gets to more words, when THE HORSE arrives.
Example:
Quote:
THE COW -- IS HOME
THE DOG -- IS HOME
THE CAT -- IS HOME
THE HORSE -- IS HOME <-- This has only 3 whitespaces but is still formatted.
i am trying to find all 3 and 4-character length words in my file (which is huge and has alot of entries in it, a big fat wordlist!).My attempt with this regular expression (which I thought should work, found something on length search here: [URL]
cat sorted_noapostrophe.txt| grep '.{3,4}'
but it returns no results? Also to find any words starting with 'f' which are between 3 and 5 characters (inclusive) long, how can this be done?
How can I install the dict file to look works?
I am running SUSE 11.1
Here is the error:
I'm trying to highlight some key words as tailing a log file using a perl script; about my case: I want to search for a keyworrs just once and highligt all occurrence of them. I want just highlit the keywords but not the whole line but the problems are that perl just catches the first keyword in a line and skip checking for other occurrence. for example if a line like "Error: some exception happen, Unable to process" it just highlight the error and do not process the remain part of the line where it should hilight the word "exception" and "Unable"
2-How can I do some action if for exapmle at least 4 time "unable" message appear ( not just in one line but diffrent line)in below is how I use perl search and replace : Code: s/(?:(unable|exception|warning))/e[1;31$&.......
Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.
As an example : I have text file with orders and returns :
Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store
My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)
I'm looking for a tool that can directly convert mp3 file to a swf file. Tried ffmprg - 'ffmpeg -i master.mp3 -ar 22050 -ab 32 -f swf -y -vn new.swf', output is as follows:
Output #0, swf, to 'new.swf':
Stream #0.0: Audio: 0x0000, 22050 Hz, stereo, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec for output stream #0.0
I found a way to perform this task using ffmpeg to convert the mp3 file to a wav file, and converting the wav into a swf file using swftools (wav2swf), although this is not a good option because the output swf file size is very big - for a 12mb input 320kbps stereo mp3 file, the swf file is 25mb. Also downloaded a free direct mp3 to swf conversion software, which had an output swf file - with the same 12mb mp3 file - of ~400kb.
The requirements I have from the tool are:
1. Can be ran from the shell.
2. Direct conversion, or an indirect one that will produce a small output swf file.
3. Suport for multiple file conversion is a plus.
just wondering does unbuntu come with a file sharing program like lime wire or somethig like that? if not what is the best out there for ubuntu
View 4 Replies View RelatedI have a whole bunch of songs in WMA and I would really like them in MP3. I paid for the songs and my husband really doesn't like downloading so that's not a option. I would really be upset if there were no way to get these back. I've tried to read a couple of sites but I don't understand any of it. Some people said to get Audacity but that program doesn't even open WMA...not even to import.
View 6 Replies View RelatedI got squid3 installed on ubuntu server 10.4. I believe it is up and running as I can browse the internet on my other computers.I followed one of the tutorials on the net and looked at others for guide as well. Everyone of them did not mentioned that we have to create the swap files. Are we suppose too? I couldn't find the location of the swap file anywhere on the server.
View 1 Replies View RelatedI need to find a Broadcom BCM4312 driver that has a .inf file extension. I cannot find one anywhere. I need to atleast once use wireless inside of ubuntu.
View 2 Replies View RelatedOnce more I am playing with Linux. First it was Mandrake on an 386/33 box. Then Ubuntu 8.04 on an Athlon 64 box. And now Ubuntu 10.04 on an Athlon 64 Black. In Windows, there are beaucoup utilities, such as disk cleanup, dupe file finder, et cetera. I already know to NOT defrag a Linux HDD. Is there a need for any of the more common Windows disk utilities in Linux? FWIW - If I don't run Norton Utilities, CCleaner, and Glary Utilities regularly in Win7, I endup with gigabytes (yes, gigabytes) of trash files.
View 3 Replies View Relatedi was copying a large file through scp (in root account), suddenly had to turn off remote machine. i suspect the unfinshid file is somewhere in my system , i need to find and delete it
Code:
Filesystem Size Used Avail Use% Mounted on
rootfs 13G 12G 966M 93% /
[code]...
For some reason, a configuration file is being rewritten by "make" but the makefile is a bit big and I can't figure out where/when it happens. Is there a tool in Linux that would let me stop execution of "make" just before it tries to modify that configuration file? I read about inotify, but I don't know if it's the right tool.
View 3 Replies View RelatedI have a file in which I have string called "already there" in some line of it. I want that if the string is present enter some loop..
like
if(( grep "already there" $file is true ))
then
--
--
fi
But the thing is when I make grep it gives the whole line in which this string is present and gives some error: if[ grep "already there" file ]: command not found. I am very new to shell scripting.
creating a mailing list I need a software that can do that. Other formats like txt or rtf would be great too, as I can easily convert.
View 4 Replies View RelatedCan anyone recommend good file recovery software for Fedora? I accidentally deleted an iPlayer file (not critical) from an NTFS partition. I tried booting into Windows and using Recuva - it can find the file intact (I can see from the file size it's the correct one) but the directory structure is gone and the file is nameless. EDIT: got it back with Recuva in Windows, just needed to run Recuva as admin.
View 2 Replies View RelatedI have a many process running in my machine with similar command and the command is 'gzip'. It is running by a program in a file. How will I find out the file which is behind this command.
View 4 Replies View Related