Learn X in Y minutes

submited by
Style Pass
2024-11-07 19:00:03

Sed is a standard tool on every POSIX-compliant UNIX system. It’s like an editor, such as Vim, Visual Studio Code, Atom, or Sublime. However, rather than typing the commands interactively, you provide them on the command line or in a file.

Sed‘s advantages over an interactive editor is that it can be easily used to automate text processing tasks, and that it can process efficiently huge (terabyte-sized) files. It can perform more complex tasks than grep and for many text processing tasks its commands are much shorter than what you would write in awk, Perl, or Python.

Sed works by reading a line of text (by default from its standard input, unless some files are specified as arguments), processing it with the specified commands, and then outputting the result on its standard output. You can suppress the default output by specifying the -n command-line argument.

Leave a Comment