Skip to content
Advertisement

Tag: hosts

In bash got unwanted newlines after sed and cat >>

I’m trying to substitute some lines in /etc/hosts file with my script here: It searches e.g. for lines like and replaces the line (if it’s found) with a sed command to nothing, but adds afterwards e.g. to I’m having to do (?) this because my LAN network addresses are changing very often (exactly: at each working day, but not always

Grouping some lines into one

I have an hosts file and I need to group multiple lines into one, using Linux standard commands; starting with this: I want this: The ip address is always the same, and I can easily remove it to simplify the work; the file can reach 30K+ lines, so my goal is to reduce its size using as few resources as

Advertisement