Use grep
:
cat > in_file <<EOF
gene1 previous name1
gene2 previous name2
gene3 previous name3
gene4 previous name4
EOF
cat > pat_file <<EOF
gene2
gene4
EOF
grep -v -f pat_file in_file
Output:
gene1 previous name1
gene3 previous name3
Here, grep
uses the following options:
-v
: Print lines that do not match.
-f file
: Obtain patterns from file, one per line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…