seq Command in Linux: Generate Numeric Sequences in Terminal
Linuxcommands
The sed command in Linux is a powerful string editor for filtering or editing text streams.
The most common options are:
- -e: Adds a script to the commands to be executed;
- -f file: Adds the contents of a file as a script to be executed;
- -r: Uses regular expressions in the script.
Examples:
To replace expressions with others, we use the "s", with "/" delimiters, so that the first occurrence is the text to search for, and the second the text that will be replaced. Note that sed will only replace the first occurrence of each line, and it is case-sensitive. The standard output of sed will be the terminal.
$ cat arquivoHoje fará calor de noite. A Noite é bela.$ sed s/noite/dia/ arquivoHoje fará calor de dia. A Noite é bela.
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Liked it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.