General :: Searching Words With Space?

May 26, 2011

I want to search lines with these stings with one or more spaces..


a b
a b
a b
a b

How will I achieve this by egrep ?

View 14 Replies


General :: Searching Files For Specific Words Or Phrases

Jan 31, 2011

I have word like initialize_my_var:in sample.php and I included three library files, take it as a.php, b.php, c.php ,I really don't know where my label(initialize_my_var:)definition is present in my library files, is it possible with a pattern matching string to find which library file really have the exact term "initialize_my_var:" , I'm really looking for an exact pattern match.

View 1 Replies View Related

General :: Keeping A Constant Space Between 2 Words In A File?

Oct 6, 2010

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:



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:



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.



THE HORSE -- IS HOME <-- This has only 3 whitespaces but is still formatted.

View 8 Replies View Related

General :: Printf White Space - Words Splitting?

Jun 15, 2010

I am having trouble keeping the name together and the phone number together, I think due to the white space. I have tried "" and '' it doesn't seem to matter. So it may be my syntax? and does it matter how long the first and last names are.

me$ echo 'fstname lstname' '123 123-1234' | ./myscript
read a b
printf "%-15s %20s
" $a $b >> my_phone_numbers

insted of
fstname lstname
123 123-1234

I know its not an elegant script but I am still learning how some commands work.

View 2 Replies View Related

General :: Division Of Logical Memory Space In To User Space And Kernel Space

Jan 4, 2010

Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?

1. How can we change it? (just changing value of PAGE_OFFSET is okay?)

2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?

View 2 Replies View Related

General :: GREP On Words With 2 Or More Z's?

Dec 21, 2010

I need to grep a dictionary file.Only the words that contain 2 or more z's and only 1 b needs to be listed.

View 1 Replies View Related

General :: Add Quotes Between Words In A Cvs File?

Mar 8, 2010

I exported a spreadsheet file into cvs format.

The cvs file is formatted this way


I want it to be in a Quote delimited format like so


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

General :: Finding Words In Files?

Apr 23, 2010

I 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 Related

General :: Vim Replace All The Same Words In A Certain Line?

Dec 2, 2010

15 for(i = 0; i < N; i++) I want to replace "i" with "test" in the line above,whose line number is 15. When I tried this command :15s/i/test/ Line 15 turned to be this: for(test = 0; i < N; i++) It only replace the first "i",but I want to change all "i" in line 15.

View 3 Replies View Related

General :: Grep 2 Words At The Same Time?

Sep 9, 2010

I want to grep any line with "john" or "jack". How to do that? I tried

grep john | grep jack
but it didn't work

View 2 Replies View Related

General :: Show Only Unique Words Between Two Files?

Feb 23, 2011

Hi, My name is John smith
Hi, My name is smith

I want to show only the different or unique word between the two files (John)i was trying to get it with diff, comm, sort, uniq, grep, awk, sed

View 5 Replies View Related

General :: Count Words With Comma As Separator?

Feb 16, 2010

I'm trying to count words in a text file that has a comma as separator. I know that I must user wc -w, but wc uses space as a separator

View 2 Replies View Related

General :: Use Grep To Find The Words In The Dictionary?

Dec 1, 2010

I'm trying to use grep to find the words in the dictionary that contain the letters "th" and the letter m.

I tried grep 'th m*.' Desktop/Dictionary/words(Thats where the destined dictionary word document is located)

grep 'th' Desktop/Dictionary/words works but only for the words with th. I have no idea of what expression to use to make it a unionized expression with m

View 3 Replies View Related

General :: Sed Regex To Match Words Via A Pattern

Oct 24, 2010

I have some lines of text and I want to detect words that meet some criteria with sed.

E.g. The line "tetris cat dog test cactus stereotype"

I want to detect the word that contains two (2) ore more t letters. That mean the words tetris, test and stereotype.

The following regex doesn't do the job because it can;t distinguish words very well.

I thinks I have ti incorporate something like [^ ] in the regex but I wasn't successful...

View 3 Replies View Related

General :: Remove Words In A File Using Sed Or Any Other Command?

Nov 30, 2009

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


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



View 4 Replies View Related

General :: Remove Words / Text In Directory?

Feb 24, 2011

I have a folder with many many files. e.g html, docs, excel sheet, script etc.
Now I want to find {using grep command}a certain word in that folder/directory and delete it in all the files and scripts that have it.

For example, I want to delete the word /testing (with the slash) in all files in a directory.

View 14 Replies View Related

General :: Sed - Change And Capitalize Some Letters In Words?

May 9, 2011

I'm trying to use Sed to change all "l" letters with "I" in capitalized words something like this:


- and as opposite change the all "I" with "l" in a word in small letters such as:

2. DiIbert -> Dilbert

For the first case I'm using the below sentence which unfortunately changes words such as "let" in "It"


sed 's/[:upper:]*l[:upper:]*/I/g'

For the second case the below command seems to work but it might have a side effect as the one used in the first case:


sed 's/[:lower:]*I[:lower:]*/l/g'

View 7 Replies View Related

General :: Calling User Space Callback Function From Kernel Space?

Sep 22, 2009

I am writing device driver in which i have to call callback function from kernel space, which are saving my data. But the callback functions are in userspace. While accessing them i am getting segmentation fault.

View 1 Replies View Related

General :: Scripting - Cp A List Of Files Which Starts With - Or Space Without - Or Space?

Oct 14, 2009

I have a list of files in a directory which starts with - or have space.

I need to copy them back without the space or -?

linux1[sim]% ls linux1[sim]% cp ./-* ./*

View 8 Replies View Related

General :: Find Words 'struct' And 'messages_sdd_t' In Many Files

Apr 23, 2010

I 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. I have been doing this without success:

find . -type f -name '*.c' | xargs grep 'struct messages_sdd_t'

and this

find . -type f -name '*.c' | xargs egrep -w 'struct|messages_sdd_t'

View 2 Replies View Related

General :: Blocking And Disable Via Squid On The Base Of Words?

Apr 14, 2011

i am experimenting with my squid config . but i dont know how to make this confg to work.I wanted to Block the websites on term of the "words''like if any one is accessing to Porn site then the words that come out of porn is blocked. [ mostly used examples]note:i can blocked single site at a time.second if there is user is downloading MP3,AVi,mpg how can i not allowed him to download that both ways via right clicking download and direct download.

View 1 Replies View Related

General :: Finding And Removing Duplicate Consecutive Words

May 2, 2011

I 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/(.*)
/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.

View 14 Replies View Related

General :: Remove Duplicate Words Within A Particular Text In A File?

Jul 22, 2011

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:


<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>

View 14 Replies View Related

General :: Regex To Find Min / Max Length Words In File?

Jan 29, 2011

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?

View 4 Replies View Related

General :: Virtual Space Seen By Each New Process In User Space?

Jun 21, 2010

In a 32-bit system, max memory addressable is 4GB. Now Linux kernel does memory mapping division of 1GB for kernel address space and 3GB for user address space. That means 4GB of virtual address space is divided between kernel (1GB) and user (3GB).

Q1. All virtual mapping utilizes the available physical RAM without any division? I mean to say that if RAM is 512MB then a page in kernel space can lie any where RAM (leave aside old PCI dma accesses)? (How this fits to fact that kernel memory is non-pageble)

Q2. If a process is created in user space, it has visibility 4GB address space or 3GB address space?

View 2 Replies View Related

General :: Use Free Space To Extend The Space Of A Drive?

Jul 5, 2011

My system is dual boot with win7 and ubuntu. I have free space of around 10 gb. I want to add this free space to my ubuntu drive. How can i do that?

View 4 Replies View Related

General :: Searching Mac Through Terminal?

Aug 18, 2010

are there any commands to search your Mac using terminal? I tried usin grep to search but it seems somewhat unresponsive and nothing comes up.

For example, I would type "grep Files" (A folder name) and it just prints a blank line and nothing happens.

View 4 Replies View Related

General :: Incremental Searching With The `less` Utility?

Feb 26, 2010

Does less have an incremental search?

I'm on xubuntu.

View 2 Replies View Related

General :: Searching For Number Within A File?

Nov 9, 2010

I'm currently trying to design a small, simple enough shell program for area codes. I have a list of area codes in a database, and I am trying to write a program that will have a user input an area code, and then have the program print out information that immediately follows that area code in my database. I assume I need to use a find or locate command, but I'm not sure if I should be searching for a string or the number itself. The number could possibly occur at some other point in the file, though the way I have the file set up it only occurs once at the newline.

what function I should use and how I should go about it? As is I only have the absolute bare-bones beginning of having an echo for the prompt to input an area-code, and the read once it's input. Without the find I'm not sure how much farther I can get. Also, would it make it easier if I added some character such as a ! to the end of the number at the newline to make it easier to search for? With a macro that would be easy enough to do.

View 1 Replies View Related

Copyrights 2005-15, All rights reserved