From 2343b8358acc60ce0667e33ff6b9fdedabec5692 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Jan 2016 07:05:18 +0800 Subject: [PATCH] PUB:20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches @runningwater --- ...ries 4--Grep Count Lines If a String or Word Matches.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename {translated/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md (88%) diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md b/published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md similarity index 88% rename from translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md index 63cb1aa189..081ecdb9b6 100644 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md @@ -1,8 +1,9 @@ -Grep 命令统计匹配的字符串/单词行数 +grep 命令系列:用 grep 命令统计匹配字符串的行数 ================================================================================ + 在 Linux 或 UNIX 操作系统下,对于给定的单词或字符串,我们应该怎么统计它们在每个输入文件中存在的行数呢? -您需要通过添加 -c 或者 --count 选项参数来抑制正常的输出。它将会显示对输入文件单词匹配的行数,如下示: +您需要通过添加 -c 或者 --count 选项参数来抑制正常的输出。它将会显示对输入文件单词匹配的行数,如下所示: $ grep -c vivek /etc/passwd @@ -28,6 +29,6 @@ via: http://www.cyberciti.biz/faq/grep-count-lines-if-a-string-word-matches/ 作者:Vivek Gite 译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file