look命令 – 查询单词

364次阅读
没有评论

look 指令用于英文单字的查询。您仅需给予它欲查询的字首字符串,它会显示所有开头字符串符合该条件的单字。

语法格式:look [参数] [字符串] [文件]

常用参数:

-a 使用另一个字典文件 web2,该文件也位于 /usr/dict 目录下
-d 只对比英文字母和数字,其余一慨忽略不予比对
-f 忽略字符大小写差别。
-t < 字尾字符串 > 设置字尾字符串

参考示例

查询 file 文件中以 L 开头的行:

[root@linuxvip ~]# cat file 
LINUX!
Linux is a free unix-type opterating system.
This is a linux testfile!
Linux test
[root@linuxvip ~]# look L file
LINUX!
Linux is a free unix-type opterating system.

正文完