📜  找到与特定字段匹配时的 awk 打印行 - Shell-Bash 代码示例

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

代码示例1
# Basic awk syntax:
awk 'condition { print $0 }' input_file

# Example usage:
awk '$2 == "string_to_match" { print $0 }' input_file
# This prints the entire line ($0) when field 2 ($2) is equal to the
# string "string_to_match"