Results 1 to 3 of 3
Thread: command for replacing text?
Enjoy an ad free experience by logging in. Not a member yet? Register.
command for replacing text?
I want to replace this line in /etc/inittab
im making a test and trying to make setup into a single multipart command. what would the command line be?
The sed utility can do pattern matching and replacement. So for your particular example:
sed -e 's/id:5:initdefault/id:3:initdefault/' /etc/inittab
sed uses a technique called regular expressions to match patterns in the file. You can do very powerful things with it: find an online resource on regular expressions for more info.