gpt4 book ai didi

linux - 尝试使用 grep 进行过滤

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:42:43 24 4
gpt4 key购买 nike

我正在尝试创建一个过滤器来捕获所有 .exe 文件行。例如,从这个:

[05/Apr/2010:11:00:01 -0300] /~mauro/Lista_conceitos_BD_2004.DOC 200 46080

[05/Apr/2010:11:00:54 -0300] /~lucia/articles/PROPOR96-Rino.pdf 200 153253

[05/Apr/2010:11:01:32 -0300] /~daniel_leite/RenomearTudo/setup.exe 200 1692017

[05/Apr/2010:11:02:12 -0300] /~grv/tutrv/fig23.jpg 200 22821

[05/Apr/2010:11:04:11 -0300] /~lucia/TechRep/NILCTR981-RMartinse

我想得到这个:

[05/Apr/2010:11:01:32 -0300] /~daniel_leite/RenomearTudo/setup.exe 200 1692017

我正在尝试使用 grep -w '*.exe' filteredAccessLog > filteredSuccessIMGAccessLog 但它根本不起作用。如果有人能提供帮助,我将不胜感激。

最佳答案

星号表示 *,而 .意思是“任何字符”。试一试:

grep "\.exe" filteredAccessLog > filteredSuccessIMGAccessLog

关于linux - 尝试使用 grep 进行过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3118274/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com