gpt4 book ai didi

linux - 如何删除单词前的文字?

转载 作者:太空宇宙 更新时间:2023-11-04 09:36:36 25 4
gpt4 key购买 nike

寻找一种方法从下面的行中删除 [11:55:43] [Server thread/INFO]::

[11:55:43] [Server thread/INFO]: Justin has just earned the achievement [Time to Mine!]

曾尝试通过使用 sed 来做到这一点,但没有成功,因为贾斯汀这个名字可以根据获得成就的人更改为另一个用户名。

有没有一种方法可以删除用户名前的 [11:55:43] [Server thread/INFO]: 而无需指定? IE。 sed from has,但保留前面的单词并删除前面的任何内容?

最佳答案

使用 sed:

sed 's/\[.*\] \[.*\]: //' file
Justin has just earned the achievement [Time to Mine!]

关于linux - 如何删除单词前的文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25932987/

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