LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2012, 07:03 PM   #1
stevo520
LQ Newbie
 
Registered: Jun 2012
Posts: 9

Rep: Reputation: Disabled
Question wc to list most common words


I am not sure but I think I should be able to use the wc command to somehow list the most common words in a file in order of the most used first and so on? Is it possible?
 
Old 06-26-2012, 07:20 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
I'll just point you in the right direction...
Try 'wc -w' http://linux.die.net/man/1/wc and you'll need 'sort -u' http://linux.die.net/man/1/sort and some wrapper code.

http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
Old 06-26-2012, 07:30 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
For good measure I'll suggest ignoring wc for the task at hand, and
concentrate on "strings", "sort", and "uniq" ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
indexing list of words in a file johannni Linux - Newbie 5 11-29-2011 06:47 PM
looking for a program to display random words from list newbiesforever Linux - Software 10 04-23-2011 02:21 PM
Python: replacing all words found on a list General Programming 3 03-15-2010 09:57 AM
Getting Range of Words from Arg List tonyfreeman Programming 3 10-05-2006 04:35 PM
Sorting a list of words in LISP! Hady Programming 1 05-01-2004 04:29 PM


All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration