Browse Source

ag: add Chinese translation

Starccy 6 years ago
parent
commit
729b5f1008
1 changed files with 31 additions and 0 deletions
  1. 31 0
      pages.zh/common/ag.md

+ 31 - 0
pages.zh/common/ag.md

@@ -0,0 +1,31 @@
+# ag
+
+> The Silver Searcher. 类似ack,但是更快.
+
+- 寻找内容包含"foo"的文件,并列出所在的行数:
+
+`ag {{foo}}`
+
+- 在指定目录中寻找内容包含"foo"的文件:
+
+`ag {{foo}} {{path/to/directory}}`
+
+- 寻找内容包含"foo"的文件,但只列出文件名:
+
+`ag -l {{foo}}`
+
+- 忽略大小写,寻找内容包含"FOO"的文件,并只输出匹配的内容,而非整行:
+
+`ag -i -o {{FOO}}`
+
+- 在文件名包含"bar"的文件中寻找"foo":
+
+`ag {{foo}} -G {{bar}}`
+
+- 使用正则表达式来匹配文件内容:
+
+`ag '{{^ba(r|z)$}}'`
+
+- 输出文件名包含"foo"的文件名:
+
+`ag -g {{foo}}`