我有两个文件。文件 A:
Modern Tales: Age Of Invention Playstation 4, 1935, 3478-3480
Modern Tales: Age Of Invention Xbox One, 3074
Moero Chronicle Switch, 6667, 12400, 28910, 29900, 29901, 29920
MOHAA Counter Intelligence,
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary,
Mokoko X Switch, 6667, 12400, 28910, 29900, 29901, 29920
Mokoko X Xbox One, 3074
和文件 B:
MIX Game Server
MOHAA Counter Intelligence
MOHAA MatchWatch
MOHAA Missionary
MOHAA Reverend
MoneyWorks Datacentre
Monsoon Vulkano
Moonlight Game Streaming
MY-IPCAM Anywhere
如何从文件 A 中删除与文件 b 不匹配的每一行。最终文件应为:
MOHAA Counter Intelligence,
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary,
答案1
像这样:
$ grep -f file_b file_a
MOHAA Counter Intelligence,
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary,