Tag Archives: sed

Replace section in file with content from another file

While automating things, you might come across the need to replace a block of lines within a file – like replacing a section with IP addresses you want to block in an .htaccess file. Automating this task means replacing this bunch of … Continue reading

Posted in Linux Administration | Tagged | Comments Off on Replace section in file with content from another file

Add a line into a huge file

Handling huge files can be a massive challenge. In a previous post I have shown how to remove a range of lines from a huge file (which can also be used to just read a number of lines out of the … Continue reading

Posted in Linux Administration | Tagged | Comments Off on Add a line into a huge file

Remove a range of lines from a huge file

When you have to deal with a huge file containing gigabytes of data and need to delete a range of lines from it, opening it with a text editor can be a fatal mistake. As an example, in this post I will demonstrate how to delete a whole database out of a huge SQL dump without messing around with a text editor. Continue reading

Posted in Linux Administration | Tagged , | Comments Off on Remove a range of lines from a huge file