Re: recursively count the words occurrence in the text files

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

 



On 12/30/2010 11:34 AM, S Mathias wrote:
> mkdir one
> mkdir two
> mkdir three
>
> echo "word1 word2 word3">  one/asf.txt
> echo "word2 word4, word5">  one/asfcxv saf.txt
> echo "word1. word2">  one/dsgsdg.txt
>
> echo "word6, word3!">  two/sdgsd dsf.txt
> echo "word6">  two/ergd.txt
>
> echo "asdf, word2">  three/werdf.txt
> echo "word7, word8 word9 word10">  three/qwerb erfsdgdsg.txt
> echo "word4 word3">  three/web erg as.txt
>

Simplest would be:

grep -r -c word one two three

which produces:

one/asfcxv:1
one/asf.txt:1
one/dsgsdg.txt:1
two/ergd.txt:1
three/web:1
three/werdf.txt:1
three/qwerb:1

There are other options that will give you more precision, but basically 
I think that grep will give you what you want.

(If I understodd the question ... )
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux