fbpx Generate Numeric Sequences in Linux: seq and for Loops | Certificação Linux

seq Command in Linux: Generate Numeric Sequences in Terminal

📅 01/01/2019 ⏱ 1 min ✍️ Uira Ribeiro
Linuxcommands
seq Command in Linux: Generate Numeric Sequences in Terminal
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

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

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp