Grep all words with "con" in them from a dictionary?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grep all words with "con" in them from a dictionary?
# 1  
Old 10-06-2008
Error Grep all words with "con" in them from a dictionary?

Is it possible to grep all words with the string "con" "Con" "CON" etc. etc. from a dictionary?

for instance "magic command 'con' dictionary" will spit out words such as Confluence, contended, inconceivable etc etc.

I really need this! Thank you!
# 2  
Old 10-06-2008
it will give the full line where that word exist
Code:
grep -i 'con' inputfile

# 3  
Old 10-06-2008

Code:
dic=/usr/share/dict/words
grep -i con "$dic"

See also Chris F.A. Johnson's Word Finder and Anagram Solver.
# 4  
Old 10-06-2008
please define "inputfile"

Quote:
Originally Posted by vidyadhar85
grep -i 'con' inputfile

Where is the input file that I am looking for? a dictionary most likely

where is such a file on an ubuntu machine? I can look and install stuff, but i'd prefer to do this operation on ubuntu...
# 5  
Old 10-06-2008
try search in this path
cd /usr/share/dict
there you find a file called words use that as infile
# 6  
Old 10-06-2008
what packages are responsible for this file? or which packages supply additional dictionaries?

please help me debug, i believe this is the fault of a nonexistant words file on my machine...

----

output of ls -al in /usr/share/dict
Code:
guptaxpn@greentea:/usr/share/dict$ ls -al
total 24
drwxr-xr-x   2 root root   32 2008-09-26 19:32 .
drwxr-xr-x 266 root root 4096 2008-10-06 17:41 ..
-rw-r--r--   1 root root  199 2008-04-21 04:04 README.select-wordlist
lrwxrwxrwx   1 root root   30 2008-09-26 19:32 words -> /etc/dictionaries-common/words
guptaxpn@greentea:/usr/share/dict$

shell script
Code:
guptaxpn@greentea:~$ more dict.sh 
#! /bin/bash

dic=/usr/share/dict/words
grep -i con "$dic"
guptaxpn@greentea:~$

output of shell script
Code:
guptaxpn@greentea:~$ ./dict.sh
grep: /usr/share/dict/words: No such file or directory
guptaxpn@greentea:~$

# 7  
Old 10-06-2008
Quote:
Originally Posted by guptaxpn
what packages are responsible for this file? or which packages supply additional dictionaries?

Use your favourite package manager to search for it or download the singlewords file from my WordFinder site mentioned above.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

2. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

3. AIX

"Frames" and "Words" in fcstat output

What are "Frames" and "Words" in the fcstat output? vio1:/home/padmin:# fcstat fcs0 <snip> Transmit Statistics Receive Statistics ------------------- ------------------ Frames: 122844229 363445456 Words: 50940091904 171210861568 <snip> The... (1 Reply)
Discussion started by: kah00na
1 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

6. AIX

xx=`date +"%a %b %d"`;rsh xxx grep "^$XX" zzz ?

AIX 4.2 I am trying to do an rsh grep to search for date records inside server logs by doing this : xx=`date +"%a %b %d"` rsh xxx grep "^$XX" zzz gives : grep: 0652-033 Cannot open Jun. grep: 0652-033 Cannot open 11. But if I do : xx=`date +"%a %b %d"` grep "^$XX" zzz it works... (2 Replies)
Discussion started by: Browser_ice
2 Replies

7. Shell Programming and Scripting

ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"

Hi, I don't know hot to make this command work: ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt" It should return the list of file .txt It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
Login or Register to Ask a Question