如何使用 Shell 命令在 linux 当中统计很多文件当中所有的中文字符
grep -P '[\p{Han}]+' **/*.md -oh | tr -d '\s' > cat.log
-P 是正则表达式匹配
-h, --no-filename
Suppress the prefixing of file names on output. This is the default
when there is only one file (or only standard input) to search.
-o, --only-matching
Print only the matched (non-empty) parts of a matching line,
with each such part on a separate output line.
本博文本意在于记录个人的思考与经验,部分博文采用英语写作,可能影响可读性,请见谅
本文来自博客园,作者:ZXYFrank,转载请注明原文链接:https://www.cnblogs.com/zxyfrank/p/17932730.html