首页 > 其他分享 >awk - $NF

awk - $NF

时间:2022-10-25 09:25:15浏览次数:48  
标签:ZUBT NF tail awk ls zzh

ZUBT:~ $>ls -ltr| tail -1
drwxrwxr-x 3 zzh zzh 4096 Oct 24 18:03 aaa

ZUBT:~ $>ls -ltr| tail -1| awk '{print $NF}'
aaa

NF is a predefined variable whose value is the number of fields in the current record. awk automatically updates the value of NF each time it reads a record.

 

标签:ZUBT,NF,tail,awk,ls,zzh
From: https://www.cnblogs.com/zhangzhihui/p/16823783.html

相关文章