Delete all lines of a file containing a regex pattern using sed. For example you can delete all commented lines of a default configuration file. Take a look on my basic regex cheat sheet
1 |
sed -i '/regexPattern/d' path/to/file1.log |
Delete all lines of a file containing a regex pattern using sed. For example you can delete all commented lines of a default configuration file. Take a look on my basic regex cheat sheet
1 |
sed -i '/regexPattern/d' path/to/file1.log |
Comment specific line using sed command can be used to configuration files …
1 |
sed -i '123 s/^/#/' filename |