DONE BY: ALIA BIN TOUQ
Linux Principles and
Investigating Linux's Principles and Philosophy
You can frequently select
A product or technology on purely
pragmatic grounds—what OS works well
for a given task, which software suite is the
least expensive, and so on.
This is true of some Linux users; the open
source model of Linux, “Selecting an
Operating System,” has implications that
can affect how Linux works. Furthermore,
some people in the Linux world can
become quite passionate about these
Nine major tenets
There are nine major tenets to the Linux
Small is Beautiful
Each Program Does One Thing Well
Prototype as Soon as Possible
Choose Portability Over Efficiency
Store Data in Flat Text Files
Use Software Leverage
Use Shell Scripts to Increase Leverage and
Avoid Captive User Interfaces
Make Every Program a Filter
Make every program a filter
Each of the commands that make up this command line
program is a filter. That is each command will take an input,
usually from Standard Input, and “filters” the data stream by
making some change to it, then sends the resulting data stream
to Standard Output. Standard Input and Standard Output are
known collectively as STDIO.
Small is beautiful and
Each program does one thing well
These two tenets go hand in hand.
Each of the commands in this program
is fairly small, and each performs a
specific task. The sort command, for
example does only one thing. It sorts
the data stream sent to it via Standard
Input and sends the results to
Standard Output. It can perform
numeric, alphabetic and alphanumeric
sorts in forward and reverse order. But
it does nothing else.
Choose portability over efficiency and
Use shell scripts to increase leverage and
The portability of shell scripts can be far more efficient
in the long run than the perceived efficiency of writing a
program in a compiled language—not even considering
the time required to compile and test such a program—
because they can run on many otherwise incompatible
Use software leverage
Software leverage means a couple things to me. First, and in the context of
this example, it means that by using four command line commands, we are
leveraging the work of the programmers who created those commands with
over 7,000 lines of C code. That is code that we do not have to create. We are
leveraging the efforts of those other, under-appreciated programmers to
accomplish the task we have set for ourselves.
This article is not meant to be a programming tutorial. Rather, it is
intended to illustrate how the Linux Philosophy impacts and
informs the daily work of system administrators and developers.
We are the beneficiaries of decades of code that was well-designed,
well-thought out, and well-written by people who had a lot of skin in
the game and actually knew what they were doing.
The best code on the planet was written using these tenets.
The impact of the Linux philosophy
When Unix was being developed in the late
1960s and early 1970s, the developers were
intent upon building an operating system
that was significantly different from the
operating systems that preceded.
The philosophy of Unix was markedly
different from that of other operating
systems. And the Linux philosophy is quite
naturally derived directly from the Unix
Over the years a number of people have attempted to enlighten the rest of us
when they codified various aspects of the Linux philosophy.
Mike Gancarz first wrote The Unix Philosophy and then followed it up
with Linux and the Unix Philosophy. These books list 9 major tenets and 10
Eric Raymond has 17 Unix rules in his book, The Art of Unix programming.
And, Oregon State University has it's own Linux philosophy which I think nicely
depicts an engineer's view of Linux.
The terminal case
The Linux philosophy is epitomized by the ease with which one can open a
terminal emulator to access the CLI and its concomitant power.
First, there are the multiple virtual terminals that can be accessed using the
Ctrl-Alt-F [1-7] keys.
Even the Linux GUI desktops whispers, "Use the force, Luke," to all who use
them. Linux has several fine GUI desktop environments from which to choose
so that every user can choose the one he or she likes best.
Linux does not handhold. It assumes you know what you are doing when you
type a command and it proceeds to execute that command without asking if
you really want to. It gives you complete control.
Other operating systems let you know that
you can use nails but don't tell you what
tool is used to insert the nails let alone
allow you to put your own finger on the
Yes, there is danger where there is great
power. Used wisely that power can also be
harnessed to accomplish many great
The Linux prime directive
This amounts to allowing each user to do
things her or his own way with a wide choice
of powerful tools.
It means making flexibility, simplicity, and
freedom the foremost considerations when
designing and building software systems.
It has resulted in the creation of software that
is such a work of art that it is still beautiful
and going strong after almost 45 years for
Unix and for more than 20 years for Linux.
Everything is a file. ( Including hardware )
Small, single-purpose programs.
Ability to chain programs together to perform
Avoid captive user interfaces.
Configuration data stored in text.
Everything is a File : –
UNIX systems have many powerful utilities designed to
create and manipulate files. The UNIX security model is
based around the security of files. By treating everything as
a file, a consistency emerges. You can secure access to
hardware in the same way as you secure access to a
Small, single-purpose programs :
UNIX provides many small
utilities that perform one
task very well. When new
functionality is required,
the general philosophy is to
create a separate program
– rather than to extend an
existing utility with new
Ability to chain programs together to
perform complex tasks :-
A core design feature
of UNIX is that the
output of one program
can be the input for
another. This gives the
user the flexibility to
combine many small
programs together to
perform a larger, more
Avoid captive user interfaces :-
Interactive commands are rare in UNIX. Most
commands expect their options and arguments
to be typed on the command line when the
command is launched.
The command completes normally, possibly
producing output, or generates an error
message and quits. Interactivity is reserved for
programs where it makes sense, for example,
text editors (of course, there are non-
interactive text editors too.)
Configuration data stored in text : –
Text is a universal interface, and many UNIX utilities exist to manipulate
Storing configuration in text allows an administrator to move a
configuration from one machine to another easily.
There are several revision control applications that enable an
administrator to track which change was made on a particular day, and
provide the ability to roll back a system configuration to a particular date
Eric Raymond: The Art of Unix Programming
Mike Gancarz: Linux and the Unix Philosophy; Digital Press,
2003, ISBN 1-55558-273-7
Oregon State University: