One-Liner

noun

say it: “wun-LY-ner” /ˌwʌnˈlaɪnər/

A whole job written as one line of commands, usually several joined by pipes.

What is a one-liner?

A one-liner is a whole job done in one line of commands, usually a pipeline that takes a file in at the left and prints an answer at the right. To read someone else's, run it up to each | in turn and say what that stage hands to the next.

grep ' 404 ' access.log | cut -d' ' -f7 | sort | uniq -c | sort -rn

In a sentence

  • “Diego read the one-liner from the left, running it up to each pipe to see what it handed on.”
  • “The one-liner grep, cut, sort and uniq -c turned a day's web log into a list of broken pages.”

Level: Apprentice · More Unix terms at this level

Updated