Portada

Este es el blog del buscador temático sobre el open source Via Alternativa, basado en la API de Google.

En este espacio encontrarás noticias de varias fuentes RSS relacionadas con el mundo del código abierto y comunidades gnu-linux.

Todo el contenido de las anotaciones es responsabilidad de aquellos que las escriben y sus respectivas webs. Si administras una web enlazada por RSS y no estás de acuerdo con la redistribución de tus contenidos contacta con nosotros.

¡A divertirse!

Vivimos en una sociedad profundamente dependiente de la ciencia y la tecnología y en la que nadie sabe nada de estos temas. Ello constituye una fórmula segura para el desastre.

— Carl Sagan

Logo Via Alternativa

Entradas recientes

Everything You Need to Know about Linux Input-Output Redirection

Everything You Need to Know about Linux Input-Output Redirection

Are you looking for information related to the Linux input-output redirection? Then, read on. So, what’s redirection? Redirection is a Linux feature. With the help of it, you are able to change standard I/O devices. In Linux, when you enter a command as an input, you receive an output. It’s the basic workflow of Linux.

The standard input or stdin device to give commands is the keyboard and the standard output or stdout device is your terminal screen. With redirection, you can change the standard input/output. From this article, let’s find out how Linux input-output redirection works.

Standard Streams in Input-Output Redirection

The bash shell of Linux has three standard streams of input-output redirection, 1) Standard Input or Stdin, 2) Standard Output or Stdout, and 3) Standard Error or Stderr.

The standard input stream is denoted as stdin (0). The bash shell receives input from stdin. The keyboard is used to give input. The standard output stream is denoted as stdout (1). The bash shell sends the output to stdout. The final output goes to the display screen. Here 0, 1, and 2 are called file descriptors (FD). In the following section, we’ll look into file descriptors in detail.

File Descriptors

In Linux, everything is a file. Directories, regular files, and even the devices are considered to be files. Each file has an associated number. This number is called File Descriptor or FD.

Interestingly, your terminal screen also has a definite File Descriptor. Whenever a particular program is executed, its output gets sent to your screen’s File Descriptor. Then, you can see the program output on the display screen. If the program output gets sent to your printer’s FD, the output would be printed.

0, 1, and 2 are used as file descriptors for stdin, stdout, and stderr files respectively.

Input Redirection

The ‘<’ sign is used for the input or stdin redirection. For example, Linux’s mail program sends emails from your Linux terminal.

You can type the email contents with the standard input device, keyboard. However, if you’re willing to attach a file to the email, use Linux’s input redirection feature. Below is a format to use the stdin redirection operator.

Mail -s "Subject" to-address < Filename

This would attach a file with your email, and then the email would be sent to a recipient.

Output Redirection

The ‘>’ sign signifies the output redirection. Below is an example to help you understand its functions.

  1. How to Use the VI Editor in Linux Deja un comentario
  2. Primer to Container Security Comentarios desactivados en Primer to Container Security
  3. Scrolling Up and Down in the Linux Terminal Comentarios desactivados en Scrolling Up and Down in the Linux Terminal
  4. Self-Hosted Static Homepages: Dashy Vs. Homer Comentarios desactivados en Self-Hosted Static Homepages: Dashy Vs. Homer
  5. GIMP in a Pinch: Life after Desktop Comentarios desactivados en GIMP in a Pinch: Life after Desktop
  6. Geek Guide: Purpose-Built Linux for Embedded Solutions Comentarios desactivados en Geek Guide: Purpose-Built Linux for Embedded Solutions
  7. How to Install and Uninstall KernelCare Comentarios desactivados en How to Install and Uninstall KernelCare
  8. What’s KernelCare? Comentarios desactivados en What’s KernelCare?
  9. Getting Started with Docker Semi-Self-Hosting on Linode Comentarios desactivados en Getting Started with Docker Semi-Self-Hosting on Linode
  10. 5 Lesser-Known Open Source Web Browsers for Linux in 2022 Comentarios desactivados en 5 Lesser-Known Open Source Web Browsers for Linux in 2022
  11. Simulating Host Identity Protocol-Based Virtual Private LAN Service Using Mininet Framework Comentarios desactivados en Simulating Host Identity Protocol-Based Virtual Private LAN Service Using Mininet Framework
  12. 6 Best Linux Desktop Environments to Try in 2022 Comentarios desactivados en 6 Best Linux Desktop Environments to Try in 2022
  13. Creating a Modern Website with Ghost Comentarios desactivados en Creating a Modern Website with Ghost
  14. Simple Network Management Protocol – Not As Simple As You Would Suggest Comentarios desactivados en Simple Network Management Protocol – Not As Simple As You Would Suggest
  15. 17 Important Linux Interview Questions with Answers Comentarios desactivados en 17 Important Linux Interview Questions with Answers
  16. The org-mode LaTeX exporter: LaTeX for non-TEXers Comentarios desactivados en The org-mode LaTeX exporter: LaTeX for non-TEXers
  17. Discourse is the Future of Web Forums Comentarios desactivados en Discourse is the Future of Web Forums
  18. 5 Distributions Of Linux To Consider For Your Server Comentarios desactivados en 5 Distributions Of Linux To Consider For Your Server
  19. Three Ways To Improve Your Programming Skills Comentarios desactivados en Three Ways To Improve Your Programming Skills