我试图在文件中删除不包含两个单独术语的行。我得到了它的工作,但不知道它是如何工作的。
sed -i '/^HETATM/!{/^ATOM/!d}' file
有人可以解释一下吗?
答案 0 :(得分:1)
您的sed行将删除所有不以HETATM
或ATOM
'/^HETATM/! #if the line is not starting with HETATM, continue to process
{/^ATOM/!d}' #then we come here, if the line is not starting with ATOM, Del the line
我会这样写:
sed '/^A\|^B/!d'