The Unix philosophy, originated by Ken Thompson1, is a set of cultural norms and philosophical approaches to minimalist, modular software development. It is based on the experience of leading developers of the Unix operating system.
Early Unix developers were important in bringing the concepts of modularity and reusability into software engineering practice, spawning a "software tools" movement. Over time, the leading developers of Unix (and programs that ran on it) established a set of cultural norms for developing software, norms which became as important and influential as the technology of Unix itself. This has been termed the "Unix philosophy".
The Unix philosophy emphasizes building simple, short, clear, modular, and extensible code that can be easily maintained and repurposed by developers other than its creators. The Unix philosophy favors composability as opposed to monolithic design. Doug McIlroy2 — then head of the Bell Labs3 Computing Sciences Research Center and inventor of the Unix pipe — summarized the Unix philosophy as follows:
This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
As stated by McIlroy, and generally accepted throughout the Unix community, Unix programs have always been expected to follow the concept of DOTADIW, or "Do One Thing and Do It Well".
Try to find out what task is performed by the following Unix commands:
date
sleep
time
history
clear
This can be done in (at least) the following three ways:
execute the command and inspect its output
take a look at the command's manual page by executing
$ man <command>
$ info <command>
use the command's --help or -h option
$ <command> --help
$ <command> -h
Take into account that not all Unix commands support some form of help option.
Each of the following tasks can be performed by at least one of the above commands. Determine which command can be used and figure out what options (flags) and/or arguments need to be given with each command.
wait three seconds
measure how long it effectively takes to execute the command to wait three seconds
write out four lines that each contain a single integer, corresponding to the current day, the current month, the current hour and the current minute
show the last three commands that were executed on the Unix command line