使用 find、wc 和 sed 计算行数 [英] Use find, wc, and sed to count lines

查看:18
本文介绍了使用 find、wc 和 sed 计算行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 sed 来计算基于特定扩展名的所有行.

I was trying to use sed to count all the lines based on a particular extension.

find -name '*.m' -exec wc -l {} ; | sed ...

我正在尝试执行以下操作,如何在此特定行中包含 sed 以获取总数.

I was trying to do the following, how would I include sed in this particular line to get the totals.

推荐答案

你也可以从 wc 获得漂亮的格式:

You may also get the nice formatting from wc with :

wc `find -name '*.m'`

这篇关于使用 find、wc 和 sed 计算行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆