I have a directory dash7/
which contains multiple text files and I want to remove all lines containing the string D PRINT
from all those files.
How can I do that easily from the command-line?
command linetext processing
I have a directory dash7/
which contains multiple text files and I want to remove all lines containing the string D PRINT
from all those files.
How can I do that easily from the command-line?
Best Answer
You can achieve this rather easily with
sed
which can happily look into multiple files/D PRINT/
find a line withD PRINT
d
delete the linedash7/*
look in all the files in the directorydash7
(add the path to it, for example~/dash7
if required)To actually change the files rather than print the edited text in the terminal, you need to add the
-i
flag to modify in place