Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

How to Redirect Text Input/Output in Linux (cat, tee)

Автор: Cyberspatial

Загружено: 2020-09-12

Просмотров: 16504

Описание:

Redirecting text and data in the Linux command-line is an essential part of system administration. In this video you'll learn how to use cat, tee, and the Bash redirection symbols. This will let you pass data between the standard out, standard in, and standard error file descriptors.

Scripting is an essential part of cybersecurity. Almost every command line tool has some kind of text output, including error messages. If you want to capture these messages to a log file or pipe them to other commands, redirection is the answer.

In Linux, every is a file, from links, sockets, to devices. What's printed on the terminal (standard out) is a special device file located at /dev/stdout. Error messages (standard error) are stored in /dev/stderr. Terminal input (standard error) are in /dev/stdin.

To better access these buffers, bash conveniently provides several shortcuts that references them.
The greater than arrow writes to standard out.
The greater than arrow with a 2 before it writes to standard error
The less than arrow reads from standard in.

When you display the contents of a file using the cat command, Bash actually passes the file's contents as input into the tool. Cat will then write the contents to the standard out file, which displays on the screen.

When you pipe a command's output to the tee command, it will write it to both standard out and a file of your choice.

In essence, anything that can be read or written from the terminal screen can be passed to a file. And vice versa.

00:00 Introduction
00:33 Key Principles for Bash Redirection
00:49 Linux File Descriptors
01:35 Redirecting Standard Output to a File
01:50 Displaying a File with Cat
02:00 Redirecting Data to Standard Input
02:55 Appending Output to a File
03:08 Truncating/Zeroing a File
03:27 Tee Command (Write to Standard Out and a File)
04:20 How to Use /dev/null
05:10 Redirecting Standard Error to Standard Out
05:40 Cat: Display Special Characters
07:57 How to Redirect Multiple Lines with Here Documents

We’re open to ideas and suggestions for more commands.

Let us know in the comments below!
____________________________________________
FOLLOW and SUBSCRIBE!
👉 YouTube:    / cyberspatial  
👉 Twitter:   / cyberspatial_hq  
👉 Facebook:   / cyberspatial  
👉 Instagram:
  / cyberspatial  
👉 LinkedIn:   / cyberspatial  

#Cyberspatial #LinuxTutorial #Bash

How to Redirect Text Input/Output in Linux (cat, tee)

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Ускоренный курс Linux — Потоки данных (stdin, stdout и stderr)

Ускоренный курс Linux — Потоки данных (stdin, stdout и stderr)

Идеальный скрипт на bash | Bash ideal script

Идеальный скрипт на bash | Bash ideal script

Linux/Mac Terminal Tutorial: The Grep Command - Search Files and Directories for Patterns of Text

Linux/Mac Terminal Tutorial: The Grep Command - Search Files and Directories for Patterns of Text

AWK, SED, PRINTF?!? (Linux+ Objective 1.2.2)

AWK, SED, PRINTF?!? (Linux+ Objective 1.2.2)

What is $PATH on a Linux Shell? (The Linux Crash Course Series)

What is $PATH on a Linux Shell? (The Linux Crash Course Series)

Virtualbox Tutorial: How to Build Virtual Machines

Virtualbox Tutorial: How to Build Virtual Machines

Каналы командной строки Linux и перенаправление

Каналы командной строки Linux и перенаправление

18 команд, которые навсегда изменят ваш подход к использованию Linux

18 команд, которые навсегда изменят ваш подход к использованию Linux

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

RunCode: Practical Programming Challenges (w/ Josh Rykowski)

RunCode: Practical Programming Challenges (w/ Josh Rykowski)

Почему я перешел на Linux! ТОП 5 Причин удалить Windows прямо сейчас

Почему я перешел на Linux! ТОП 5 Причин удалить Windows прямо сейчас

Linux Commands for Beginners 16 - Output Redirection

Linux Commands for Beginners 16 - Output Redirection

Разжёванный курс по Linux для чайников.  Часть 1

Разжёванный курс по Linux для чайников. Часть 1

Изучение Awk необходимо для пользователей Linux

Изучение Awk необходимо для пользователей Linux

Using touch command in Linux: Know It's Real Purpose || Updating Timestamps

Using touch command in Linux: Know It's Real Purpose || Updating Timestamps

A Beginner's Introduction to BASH Shell Scripting

A Beginner's Introduction to BASH Shell Scripting

Xargs Should Be In Your Command Line Toolbag

Xargs Should Be In Your Command Line Toolbag

​Why Good SOC Analysts Know Offense & Defense

​Why Good SOC Analysts Know Offense & Defense

Part 7 - Unix/Linux for Testers | cmp, diff & comm Commands

Part 7 - Unix/Linux for Testers | cmp, diff & comm Commands

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]