【发布时间】:2014-12-12 09:55:47
【问题描述】:
我不是这两个命令中的任何一个的专家用户,但据我了解,
如果我想在我的电脑上搜索“计算理论”这本书,
locate -i computation | grep -i theory 应该给我所有且只有名称中同时包含 theroy 和 computation 的文件。
locate -i computation 应该输出名称中包含 computation 的所有文件,并且由于管道,grep -i theory 应该输出名称中包含 theory 的所有文件,从而给我想要的输出。
但是,当我运行上述命令时,我会得到类似
的输出/root/books/History theory and practice of the electric telegraph.pdf 这意味着我对这些命令(或管道)中的至少一个的理解是错误的。我哪里看错了?
【问题讨论】:
标签: linux bash grep pipe locate