How can I remove a specific line from a file ONLY if there are other lines in the file?
For example, don't touch this file:
cat file.txt
ASDF
but remove "ASDF" from this file:
cat file.txt
ASDF
TR422
Because it has other lines than "ASDF".
I'll welcome a solution in bash, perl or any other common tool.
Best Answer
In
bash
, usingsed
: