Re: recursively count the words occurrence in the text files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Dec 30, 2010 at 10:34:58AM -0800, S Mathias wrote:
> I just can't google for it:

I'm a little concerned about the number of "schoolbook" questions showing
on this list, recently.  However...

> echo "word1 word2 word3" > one/asf.txt
> echo "word2 word4, word5" > one/asfcxv saf.txt

Yeah, that line won't work like you think.

> $ SOMEMAGIC > output.txt

I'd do something like
  cat */* | tr -c '[:alpha:]' '\012' | grep -v '^$' | sort | uniq -c

If more than just one layer of subdirs, replace the "cat */*" with
  find . -type f -exec cat {} \;

-- 

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux