Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图找到 .h 和 .m 文件的总行代码数。我不知道这个命令请帮助我。
尝试wc:
wc
wc -l your_file
wc 代表word count和-l标志它计算行数。
word count
-l
wc -l your_file给你文件中的行数。
看看man wc
find project-dir -name "*.[mh]" | xargs wc -l
这将找到所有以扩展名 m 或 h 结尾的文件,并wc计算文件中的行数。最后一行将包含总数。