Files
tldr/pages.zh/linux/look.md

26 lines
745 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# look
> 在文件中显示以特定前缀开头的行。
> 注意:文件中的行必须是排序过的。
> 另见:`grep``sort`。
> 更多信息:<https://manned.org/look>。
- 在特定文件中搜索以特定前缀开头的行:
`look {{prefix}} {{path/to/file}}`
- 在空格和字母数字字符上不区分大小写地搜索:
`look {{-f|--ignore-case}} {{-d|--alphanum}} {{prefix}} {{path/to/file}}`
- 指定字符串终止字符(默认是空格):
`look {{-t|--terminate}} {{,}}`
-`/usr/share/dict/words` 中搜索(假定 `--ignore-case``--alphanum`
`look {{prefix}}`
-`/usr/share/dict/web2` 中搜索(假定 `--ignore-case``--alphanum`
`look {{-a|--alternative}} {{prefix}}`