Reputation: 377
I need to remove some lines from a file.
In specific I need to remove all lines containing the substring: export JAVA_HOME=/usr/lib/jvm
I tried:
sed -i -e "/export JAVA_HOME=\"\/usr\/lib\/jvm*/d" file
and
sed -i -e "/export JAVA_HOME=\"\/usr\/lib\/jvm/d" file
but those don't remove the line I have in the file
that is:
export JAVA_HOME=/usr/lib/jvm/openjdk-8-amd64/jre/
Any help please? Thanks
Upvotes: 0
Views: 35
Reputation: 817128
Remove the quotation mark from your pattern, since it doesn't appear in the line you want to remove:
sed -i -e "/export JAVA_HOME=\"\/usr\/lib\/jvm/d" file
# ^^ remove this
Upvotes: 1