03-05-2011
~~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
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT OSX
dnssec-dsfromkey
DNSSEC-DSFROMKEY(8) BIND9 DNSSEC-DSFROMKEY(8)
NAME
dnssec-dsfromkey - DNSSEC DS RR generation tool
SYNOPSIS
dnssec-dsfromkey [-v level] [-1] [-2] [-a alg] {keyfile}
dnssec-dsfromkey {-s} [-v level] [-1] [-2] [-a alg] [-c class] [-d dir] {dnsname}
DESCRIPTION
dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).
OPTIONS
-1
Use SHA-1 as the digest algorithm (the default is to use both SHA-1 and SHA-256).
-2
Use SHA-256 as the digest algorithm.
-a algorithm
Select the digest algorithm. The value of algorithm must be one of SHA-1 (SHA1) or SHA-256 (SHA256). These values are case insensitive.
-v level
Sets the debugging level.
-s
Keyset mode: in place of the keyfile name, the argument is the DNS domain name of a keyset file. Following options make sense only in
this mode.
-c class
Specifies the DNS class (default is IN), useful only in the keyset mode.
-d directory
Look for keyset files in directory as the directory, ignored when not in the keyset mode.
EXAMPLE
To build the SHA-256 DS RR from the Kexample.com.+003+26160 keyfile name, the following command would be issued:
dnssec-dsfromkey -2 Kexample.com.+003+26160
The command would print something like:
example.com. IN DS 26160 5 2 3A1EADA7A74B8D0BA86726B0C227AA85AB8BBD2B2004F41A868A54F0 C5EA0B94
FILES
The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name Knnnn.+aaa+iiiii.key as generated by
dnssec-keygen(8).
The keyset file name is built from the directory, the string keyset- and the dnsname.
CAVEAT
A keyfile error can give a "file not found" even if the file exists.
SEE ALSO
dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 3658, RFC 4509.
AUTHOR
Internet Systems Consortium
COPYRIGHT
Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
BIND9 November 29, 2008 DNSSEC-DSFROMKEY(8)