linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
  • Introduction
  • Lessons
  • How it works
  • Simulator
  • Knowledge base
  • Interview prep
Lessons
Footer
linuxlab-TutorialsPricingAboutPrivacy & cookies
Copyright © 2026 LinuxLab. All rights reserved.

← из прошлого урока

xargs is in your hands. Next is a neighboring topic: redirects and file descriptors past the basics. 2>&1 in the right order, tee plus pipefail, <(cmd), here-docs, and custom FDs through exec N>.

← к прошлому уроку

Средний

Advanced redirects and file descriptors

15 мин · урок входит в курс «Средний»

In the lesson on basic file-descriptors (04-pipes) you already saw >, >>, and |. Here are five idioms that show up in any serious bash script and somehow rarely get explained together:

  • 2> and 2>&1: working with stderr separately
  • tee: write to a file and keep the pipeline going
  • <(cmd): process substitution, a command as a file
  • here-doc and here-string: data right in the script
  • exec N>file: custom FDs for long-running logs

All of these operators work by manipulating the process's integer file descriptors. There are three by default: 0 (stdin), 1 (stdout), 2 (stderr). The redirect 2>file means "open file and make it fd=2 for the command".

Урок закрыт

Чтобы запустить sandbox и пройти этот урок целиком, нужен соответствующий курс. Внутри - ещё много практических уроков того же уровня и сквозной прогресс.

Купить курсВойти← Все уроки

дальше →

Your shell tooling is now complete. Next you bring up a real service by hand: BIND9 as an authoritative DNS, the example.lab zone, the SOA serial, AXFR, and dig +trace. The services block begins.

Открыть превью: Your own DNS server on BIND9: zones and recordsв курсе «Средний» - /pricing
Footer
linuxlab-
Copyright © 2026 LinuxLab. All rights reserved.
Tutorials
Pricing
About
Privacy & cookies