我有一个包含很多行的纯文本文件,我试图只获取以|V|
和开头的行runtime
我试过的:
sed -e '/^\(runtime\|\\|V\\|\)/p' test.txt > test.out.txt
sed -e '/^(runtime\|\\|V\\|)/' test.txt > test.out.txt
sed -e '/^runtime/p' -e '/^\\|V\\|/p' test.txt > test.out.txt
sed -i.bak '/^\\|V\\|\|runtime/!d' test.txt
sed -i.bak '/^(\\|V\\|\|runtime)/!d' test.txt
pcregrep -M '^(runtime|\|V\|)*' test.txt > test.out.txt
egrep '^(runtime|\|V\|)*' test.txt > test.out.txt
没有任何效果。我会得到一个空文件或重复相同的文件。