Tag Info

New answers tagged

1

If your gateway is 150.0.3.254 You can do it this way: sed -i -E 's/([ \t]+gateway[ \t])+[0-9.]+/\1150.0.3.254/' /etc/network/interfaces Let me explain how it works: -i -> Means replace the file -E -> Use Extended regular expressions, avoids escape especial characters like ( to \( 's/<PATTERN>/<REPLACEMENT>/' -> thes` means substitution ...



Top 50 recent answers are included