Use an array
awk '{count[$3]++} END {for (word in count) print word, count[word]}' file
If you want “block” specifically: END {print count["BLOCK"]}
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- How to merge two files using AWK? [duplicate]
- Fastest way to find lines of a file from another larger file in Bash
- Convert date formats in bash
- How can I quickly sum all numbers in a file?
- Uppercasing First Letter of Words Using SED
- Insert multiple lines into a file after specified pattern using shell script
- How can I trim white space from a variable in awk?
- grep lines that contain 1 character followed by another character
- How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script
- Pseudo-terminal will not be allocated because stdin is not a terminal
- How can I generate new variable names on the fly in a shell script?
- How can I delete a newline if it is the last character in a file?
- What’s the difference between nohup and ampersand
- Redirect STDERR / STDOUT of a process AFTER it’s been started, using command line?
- Find multiple files and rename them in Linux
- Can I programmatically “burn in” ANSI control codes to a file using unix utils?
- Using the passwd command from within a shell script
- Command to get time in milliseconds
- How to create a hex dump of file containing only the hex characters without spaces in bash?
- linux: kill background task
- How can I set an environment variable only for the duration of the script?
- Linux/Unix command to determine if process is running?
- Bash: infinite sleep (infinite blocking)
- How do I pass a wildcard parameter to a bash file
- Bash: read stdin from file and write stdout to file
- bash, command not found [duplicate]
- Need to remove the count from the output when using “uniq -c” command
- Creating temporary files in bash
- Changing environment variable of a running process