awk 输出最后一列
时间: 2023-10-13 21:02:15 浏览: 204
要输出awk命令中的最后一列,可以使用$NF作为列号来表示最后一列。例如,可以使用以下命令来输出文件中的最后一列:
```
awk '{print $NF}' file
```
其中,file是你要处理的文件名。这个命令会打印文件中每一行的最后一列。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [linux awk用法详解](https://blog.csdn.net/zhangpchina/article/details/130551626)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [awk输出指定列](https://blog.csdn.net/yjk13703623757/article/details/118490721)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文