使用发现,厕所,和sed计算行 [英] Use find, wc, and sed to count lines

查看:122
本文介绍了使用发现,厕所,和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'`

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

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