STDIO was developed by Ken Thompson as a part of the infrastructure required to implement pipes on early versions of Unix. Doug McIlroy, Basics of the Unix Philosophy STDIO Write programs to handle text streams, because that is a universal interface.” “ This is the Unix philosophy: Write programs that do one thing and do it well. STDIO was first developed for Unix and has found its way into most other operating systems since then, including DOS, Windows, and Linux. The use of Standard Input/Output (STDIO) for program input and output is a key foundation of the Linux way of doing things. In this post, we will explore data streams-what they are, how to create them, and a little bit about how to use them. As a sysadmin, your job is intimately associated with manipulating the creation and flow of these data streams. In the Unix and Linux worlds, a stream is a flow of text data that originates at some source the stream may flow to one or more programs that transform it in some way, and then it may be stored in a file or displayed in a terminal session. Many of the core utilities are transformer programs and use STDIO. The ability to manipulate these data streams using these small yet powerful transformer programs is central to the power of the Linux command-line interface. As mentioned, that file could be an actual data file on the hard drive, or a device file such as a drive partition, a printer, a terminal, a pseudo-terminal, or any other device connected to a computer. Redirection can then be used at the end of the pipeline to direct the data stream to a file. Each transformer program is used by the sysadmin to perform some operation on the data in the stream, thus changing its contents in some manner. I expect that I am alone in this.ĭata streams can be manipulated by inserting transformers into the stream using pipes. Feel free to use whichever term you prefer, but I prefer transformers. They can add data to a stream, modify the data in some amazing ways, sort it, rearrange the data in each line, perform operations based on the contents of the data stream, and so much more. The air filter in my home HVAC system removes particulates that I don’t want to breathe.Īlthough they do sometimes filter out unwanted data from a stream, I much prefer the term “transformers” because these utilities do so much more. In my high school and college chemistry classes, filter paper was used to remove particulates from a liquid. ![]() By definition, a filter is a device or a tool that removes something, such as an air filter removes airborne contaminants so that the internal combustion engine of your automobile does not grind itself to death on those particulates. ![]() The standard term, “filters,” implies something with which I don’t agree. I use the term “transform” in conjunction with these programs because the primary task of each is to transform the incoming data from STDIO in a specific way as intended by the sysadmin and to send the transformed data to STDOUT for possible use by another transformer program or redirection to a file. 10 command-line tools for data analysis in Linux.
0 Comments
Leave a Reply. |