Unix is well-known for advocating the philosophy that commands should do one thing and do it well. [^1]. Sophisticated data processing operations can often be performed using the shell pipe operator to chain commands together so that the output of one becomes the input of another, manipulating and transforming data to achieve a desired result. For example: ``` # Sort file names. ls | sort # Count files. ls -l | count -l # Print out unique file extensions. # 1. List all files that have extensions # 2. Transform the data (discard everything but extensions) # 3. Sort the list (data must be sorted to identify duplicates) # 4. Filter out duplicates # 5. Browse the results ls *.* | sed 's/.*\.//' | sort | uniq | less ``` With Go, programmers can create very efficient and performant commands for processing data. We'll touch on this with the following snippets. --- Next: [[9. Line Numbers Command]] [^1]: See: https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well.