With its terse syntax and powerful mathematical operators, APL allowed useful programs to be represented in a few symbols.
Some magazines devoted regular columns solely to impressive short and one-line programs.
The authors explain the birth of the one-liner paradigm with their daily work on early Unix machines: The 1977 version had only a few built-in variables and predefined functions.
It was designed for writing short programs […] Our model was that an invocation would be one or two lines long, typed in and used immediately.
Defaults were chosen to match this style […] We, being the authors, knew how the language was supposed to be used, and so we only wrote one-liners.Notice that this original definition of a one-liner implies immediate execution of the program without any compilation.
But this strict understanding of a one-liner was broadened in 1985 when the IOCCC introduced the category of Best One Liner for C, which is a compiled language.
A single line of BASIC can typically hold up to 255 characters, and one liners ranged from simple games[3] to graphical demos.
For example, to print the last field of unix long listing: Several open-source scripts have been developed to facilitate the construction of Python one-liners.
Scripts such as pyp or Pyline import commonly used modules and provide more human-readable variables in an attempt to make Python functionality more accessible on the command line.