From the course: Linux: Bash Shell and Scripts

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using sed and AWK for more powerful scripting

Using sed and AWK for more powerful scripting - Linux Tutorial

From the course: Linux: Bash Shell and Scripts

Start my 1-month free trial

Using sed and AWK for more powerful scripting

- [Narrator] sed let's you do editing sort of commands, stuff you could do in an editor like vi, but as a filter so it's called a stream editor because you think of the input streaming through it and then it's producing output. So sed is great as a filter and it works great in scripts so you can essentially do a bunch of edits. You can have a batch of editings you do in a script, say process lots of files. Normally, sed applies it's editing commands to every line in a file if it matches something. So it processes a whole file and it doesn't change the file, it's just a file is passed into it, or maybe the output of a command is passed into it and it does it's processing, it produces the output. If you wanna use sed to actually edit a file you can do that too. You can use a sed -I option, then it applies the sed commands you've given it to the file in place. One of the most powerful things you could do with sed is use it's substitute command. The way the substitute command works is you…

Contents