This is why “Unix Pipelines” are so powerful

we my take it for granted, but pipelines makes our lives much easier

Unix Pipelines are basically the mechanism of connecting, directly, the output of a program to the input of another program.

A brief history:

“Historically” developers did not think of connecting programs at all, in fact they used to see a program as an entity that takes gives a certain output, and that’s it.

The magic Operator “ | ” :

Linux shell provided since it’s beginning the mechanism of file redirection, whith a pretty easy syntax, but the “new invention” was the idea of putting and operator “ | ” to directly connect one programs output to another’s input, and it can goes on and on with and the end multiple programs being connected.

a brief exemple of listing all sub-directories in the current directory with pipelines:

Advantages of using Pipelines:

First, with pipelines you don’t have to write a massive program, but in stead you may relay on connecting existing smaller programs wich allows to much “cleaner” modifications of the program if you need one.

Second, and the most powerful idea in my opinion is that those small programs, when connected together can work together and operate in ways that were not thought of in their original design.

another exemple on how to list all the files in an Apache log directory for the month of September in the current year




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How-to setup a semi-automated release process with GitHub action/workflow

Getting started with Spring Boot, JOOQ, Flyway, and ModelMapper

Introducing Z

A Forth VM’s Performance on Apple Silicon

TDD Part 1

(A better way to) Monitor Your Parity Substrate Node

How would you solve these questions from Google interviews?

The good old for loop

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chebbi Mounir

Chebbi Mounir

More from Medium

How to run Docker near to native speed on Mac

Pipe, Grep and Sort Command in Linux/Unix with Examples

Linux — Networking Deep Dive

autoenv: relax, ansible will setup your dev environment for you