Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-17-2012
hedkandi's Avatar
Registered User
 
Join Date: Aug 2008
Location: Doha, Qatar
Posts: 187
Thanks: 27
Thanked 9 Times in 8 Posts
Find word in a large file

Hi all

I am working on disallowing users to use easy passwords in pam.d setting on RHEL 5.7 and SuSe 11, and I was hoping to add more words into the current cracklib dict, so I use "echo" command to append new words into the file

I dont want to add the same words into the dict, I think I have too many redundant words now. I am using grep, but then grep is only going to show me so much, how do I find a word, sort it out alphabetically and pipe it to a file (that i can cross check so I dont end up adding same words into it)?


Code:
find /path/to/dir -name "itelli" <ok, im lost with sort,the only option i know is sort -nk and pipe> :(

Thanks!

---------- Post updated at 03:32 PM ---------- Previous update was at 03:22 PM ----------

Seems every time I post something here I get results on my own


Code:
find /path/to/dir -name "itelli" | sort -d >/tmp/words.txt

Sponsored Links
    #2  
Old 06-19-2012
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Location: France
Posts: 2,763
Thanks: 72
Thanked 587 Times in 561 Posts
Another approach could be to check that the wanted password match some complexity enforced rules (with a minimum number of uppercase , char, figures, punct character and so on ...)
Sponsored Links
    #3  
Old 06-19-2012
Registered User
 
Join Date: Dec 2004
Location: Isle-of-Skye
Posts: 231
Thanks: 7
Thanked 26 Times in 26 Posts
Hi HeadKandi,

A better answer would be as follows;


Code:
find /path/to/dir -name "itelli" | sort -du >/tmp/words.txt

As this will ensure that there are no duplicates in the file.

Regards

Dave
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word chicchan UNIX for Dummies Questions & Answers 6 03-30-2012 04:28 PM
Find line number of bad data in large file pchang Shell Programming and Scripting 3 01-14-2011 12:02 PM
Find and analyze variable Strings in a large file. Ashitaka007 Shell Programming and Scripting 4 07-09-2010 08:42 AM
deleting the complete line that contains a specific word from a large text file Lucky Ali Shell Programming and Scripting 2 06-15-2010 09:24 AM
find a word in a file, and change a word beneath it ?? vikas027 Shell Programming and Scripting 2 02-13-2008 03:23 PM



All times are GMT -4. The time now is 01:53 PM.