【发布时间】:2020-07-19 04:31:37
【问题描述】:
我正在尝试查找目录中文件名中具有两种不同模式的文件数。我不想要组合计数,而是显示组合结果。
命令 1:find | grep ".coded" | wc -l |输出:4533
命令 2:find | grep ".read" | wc -l |输出:654
寻找的输出:4533 | 654 在一行中
有什么建议吗?谢谢!
【问题讨论】:
-
快速但脆弱的破解:
printf "%s | %s\n" "$(find | grep ".coded" | wc -l)" "$(find | grep ".read" | wc -l)"