Is there a simple way to remove the same line of text from a folder full of text documents at the command line?
To find a pattern
and remove the line containing the pattern
below command can be used
find . -name "*" -type f | xargs sed -i -e '//d'
Example :
if you want to remove the line containing word sleep
in all the xml
files
find . -name "*.xml" -type f | xargs sed -i -e '/sleep/d'
NOTE : Be careful before choosing a pattern as it will delete the line recursively in all the files in the current directory hierarchy :)