📌  相关文章
📜  bash 打印列中唯一单词的计数 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:17.250000             🧑  作者: Mango

代码示例1
# Example usage:
awk -F '\t' '{print $7}' input_file | sort | uniq -c
# Breakdown: 
# awk returns the 7th tab-delimited column/field of the input_file
# sort sorts the entries so that duplicate entries are adjacent
# uniq -c returns the counts of each type of element

# Note, add "| cut -c 9-" to remove the counts if you only want the
#     unique values found in the column/field