Advanced Pipeline Example

Learn advanced techniques of applying pipelines.

We'll cover the following

du

Let’s go over a more complex example with pipelines and the du utility. The utility evaluates disk space usage. We run it without parameters in the current directory. The utility passes through all subdirectories recursively. It prints the space occupied by each of them.

Traversing a directory recursively means visiting all its subdirectories. If any of them has subdirectories, we should visit them, too. The traversal algorithm looks like this:

Get hands-on with 1200+ tech skills courses.