---
type: link
tags: [public, command, linux, terminal, awk]
created: 2025-11-06T02:51:46.190Z
updated: 2025-11-15T20:19:55.552Z
---# Count and print unique values in a column.

**URL:** [https://www.gnu.org/software/gawk/manual/gawk.html](https://www.gnu.org/software/gawk/manual/gawk.html)

awk | Count and print unique values in a column. awk '{count[$1]++} END {for (val in count) print val, count[val]}' file.txt


---
**Keywords:** public, command, linux, terminal, awk
