Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to delete a word from a file in bash

sed -i 's/word-to-find//g' input.file.path

#note: if you are word-to-find is a variable, put it in single quotations > ex : 's/'$var'//g'
 
PREVIOUS NEXT
Tagged: #delete #word #file #bash
ADD COMMENT
Topic
Name
5+7 =