Linux 的 look 命令用于查找以指定字符开头的行。
look [options] <string> [<file>...]-a, --alternative 使用另一个字典文件
-d, --alphanum 只比较空白和字母数字字符
-f, --ignore-case 在比较时忽略大小写差异
-t, --terminate <char> 定义字符串的结束符
-h, --help 显示帮助信息
-V, --version 显示版本信息
查找 demo 文件中以字母 d 开头的所有的行,命令如下:
# 查看 demo 文件内容
hxstrive@localhost:~$ cat demo
The open source, in-memory
data store used by millions of developers as a
database, cache, streaming engine,
and message broker.
# 查找以字符 d 开头的所有行,找到两行
hxstrive@localhost:~$ look d demo
data store used by millions of developers as a
database, cache, streaming engine,更多关于命令详细参考手册,请使用 man 命令或者 --help 参数获取帮助信息