【发布时间】:2015-01-14 19:32:23
【问题描述】:
我有一个遵循这种格式的文本文件:
http://www.mywebsite.com/user1242/random-information
http://www.mywebsite.com/otheruser/writing-other-stuff
http://www.mywebsite.com/anotheruser/fwefawef-wfefwef
http://www.mywebsite.com/testuser/fwefweaf-fawefw
http://www.mywebsite.com/testing123/this-is-a-test
我想修剪最后一部分并使列表看起来像这样:
http://www.mywebsite.com/user1242
http://www.mywebsite.com/otheruser
http://www.mywebsite.com/anotheruser
http://www.mywebsite.com/testuser
http://www.mywebsite.com/testing123
这可能与正则表达式有关还是我应该寻找其他方法来做到这一点?
我希望通过命令行来完成,但如果这样更容易的话,我可以通过 NotePad++ 之类的东西来运行它......
【问题讨论】:
标签: regex shell command-line ssh command