Sponsored Content
Top Forums Shell Programming and Scripting ~~Unix command to count a particular word in the whole directory .~~ Post 302501899 by Rabbitsfoot on Saturday 5th of March 2011 02:07:13 PM
Old 03-05-2011
Question ~~Unix command to count a particular word in the whole directory .~~

Hi ,

i'm trying to count a particular word occurance in a whole directory..is this possible Smilie

say for example there is a directory with 100 files which and all the file may have the word 'aaa' in it ...how would i count the number of 'aaa' in those whole 100 files in a directory ?

thanks for your help
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command to find the count of files ina directory

hi Gurus, can anyone provide a awk command to get teh count of number of file sin a specific directory. appreciate any kind of information.. thanks (11 Replies)
Discussion started by: sish78
11 Replies

2. UNIX for Dummies Questions & Answers

Word Count (WC) command

I have created a file "pat".This file contains the text "abcdefghi". Now i want to count the characters in this file "pat". I gave wc -c | pat and it returns me exact count "9". Now when i tried like "echo pat | wc -m" It returns '4'. as for as i understand this command "echo pat | wc -m" should... (7 Replies)
Discussion started by: mdali_vl
7 Replies

3. Shell Programming and Scripting

How to use the programming in UNIX to count the total G+C and the GC%?What command li

Seems like can use awk and perl command. But I don't have the idea to write the command line. Thanks for all of your advise. For example, if I have the file whose content are: Sample 1. ATAGCAGAGGGAGTGAAGAGGTGGTGGGAGGGAGCT Sample 2. ACTTTTATTTGAATGTAATATTTGGGACAATTATTC Sample 3.... (1 Reply)
Discussion started by: patrick chia
1 Replies

4. Shell Programming and Scripting

Word count of lines ending with certain word

Hi all, I am trying to write a command that can help me count the number of lines in the /etc/passwd file ending in bash. I have read through other threads but am yet to find one indicating how to locate a specifc word at the end of a line. I know i will need to use the wc command but when i... (8 Replies)
Discussion started by: warlock129
8 Replies

5. UNIX for Dummies Questions & Answers

Single UNIX command to display users and to count them

Hello everyone, I am new to Unix and I am stuck with a problem. I need only a single command to display the output of who and then add the total number of users and display at the bottom of that output. Example-: (Expected output) sreyan@debian:~$ <command> sreyan tty7 ... (7 Replies)
Discussion started by: sreyan32
7 Replies

6. UNIX for Dummies Questions & Answers

UNIX - command to count number of files in subdirectories

I have a folder named test/ and under that I have multiple directories and in each of the directory I have multiple log files. I want to know how many files exists under each sub directory. test |--quanrantine |--logfile1 |--logfile2 |--spooling |--logfile1 ... (4 Replies)
Discussion started by: ravikirankethe
4 Replies

7. Shell Programming and Scripting

Word count files in UNIX

My files: file1 and file2 contain 157 words. Emptyfile1 contain 0 words. My script has to output how many files is filled with words and how many that are not. If there are files that have words in it. It has to output "file2 and file2 contains 157 words, 0 files are empty" If not every... (9 Replies)
Discussion started by: johnrichards
9 Replies

8. UNIX for Beginners Questions & Answers

UNIX script to check word count of each word in file

I am trying to figure out to find word count of each word from my file sample file hi how are you hi are you ok sample out put hi 1 how 1 are 1 you 1 hi 1 are 1 you 1 ok 1 wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies

9. UNIX for Beginners Questions & Answers

Get count of multiple word in single command

Hello Experts, I have a log file that contains 4 different type of exception : 1- Exception 2- Fatal 3- Error 4- Exec My requirement is to find count of each type of exception, i tried using combination of -E and -C but that doesn't seems to be working : grep -ec 'Exception' -ec... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
GROHTML(1)						      General Commands Manual							GROHTML(1)

NAME
grohtml - html driver for groff SYNOPSIS
grohtml [ -vhlrn ] [ -Ddir ] [ -Fdir ] [ -iresolution ] [ -Iimage-stem ] [ -oimage-vertical-offset ] [ -aaa-text-bits ] [ -aaa-graphic-bits ] [ files... ] DESCRIPTION
The grohtml front end (which consists of a preprocessor, pre-grohtml, and a device driver, post-grohtml) translates the output of GNU troff to html. Users should always invoke grohtml via the groff command with a -Thtml option. If no files are given, grohtml will read the standard input. A filename of - will also cause grohtml to read the standard input. Html output is written to the standard output. When grohtml is run by groff options can be passed to grohtml using groff's -P option. OPTIONS
-aaa-text-bits Number of bits of antialiasing information to be used by text when generating png images. The default is 4 but legal values are 0, 1, 2, and 4. Note your version of gs needs to support the -dTextAlphaBits and -dGraphicAlphaBits options in order to exploit antialiasing. A value of 0 stops grohtml from issuing antialiasing commands to gs. -gaa-graphic-bits Number of bits of antialiasing information to be used by graphics when generating png images. The default is 4 but legal values are 0, 1, 2, and 4. Note your version of gs needs to support the -dTextAlphaBits and -dGraphicAlphaBits options in order to exploit antialiasing. A value of 0 stops grohtml from issuing antialiasing commands to gs. -b Initialize the background color to white. -h Generates section and number headings by using <B>...</B> and increasing the font size, rather than using the <Hn>...</Hn> tags. -l Turns off the production of automatic section links at the top of the document. -r Turns off the automatic header and footer line (html rule). -n Generate simple heading anchors whenever a section/number heading is found. Without the option the anchor value is the textual heading. This can cause problems when a heading contains a `?' on some browsers (netscape). This flag is automatically turned on if a heading contains an image. -p Display page rendering progress to stderr. grohtml only displays a page number when an image is required. -Fdir Prepend directory dir/devname to the search path for font and device description files; name is the name of the device, usually html. -iresolution Select the resolution for all images. By default this is 100 pixels per inch. Example: -i200 indicates 200 pixels per inch. -Istem Determine the image stem name. If omitted grohtml uses grohtml-XXX (XXX is the process ID). -overtical-offset Specify the vertical offset of images in points. -Ddir Inform grohtml to place all image files into directory dir. -v Print the version number. USAGE
There are styles called R, I, B, and BI mounted at font positions 1 to 4. DEPENDENCIES
grohtml is dependent upon the png utilities (pnmcut, pnmcrop, pnmtopng) and GhostScript (gs). pnmtopng (version 2.37.6 or greater) and pnmcut from the netpbm package (version 9.16 or greater) will work also. It is also dependent upon psselect from the PSUtils package. Images are generated whenever a table, picture, equation or line is encountered. BUGS
Grohtml has been completely redesigned and rewritten. It is still alpha code. SEE ALSO
afmtodit(1), groff(1), troff(1), psbb(1), groff_out(5), groff_font(5), groff_char(7) Groff Version 1.18.1 Nov 2003 GROHTML(1)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy