---
type: link
tags: [command, linux, terminal, awk]
created: 2025-11-06T02:51:46.19+00:00
updated: 2026-04-06T10:53:00.128848+00:00
---# 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:** command, linux, terminal, awk
