Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Linux principles and philosophy

970 views

Published on

updating with pictures soon

Published in: Technology
  • Be the first to like this

Linux principles and philosophy

  1. 1. DONE BY: ALIA BIN TOUQ Linux Principles and Philosophy
  2. 2. 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 principles.
  3. 3. Nine major tenets There are nine major tenets to the Linux philosophy. 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 Portability Avoid Captive User Interfaces Make Every Program a Filter
  4. 4. 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.
  5. 5. 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.
  6. 6. Choose portability over efficiency and Use shell scripts to increase leverage and portability 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 systems.
  7. 7. 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.
  8. 8. Impact 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.
  9. 9. 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 philosophy.
  10. 10. Enlightenment 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 lesser tenets. 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.
  11. 11. 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.
  12. 12. Complete control 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 trigger. Yes, there is danger where there is great power. Used wisely that power can also be harnessed to accomplish many great things.
  13. 13. 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.
  14. 14. Linux Principles Everything is a file. ( Including hardware ) Small, single-purpose programs. Ability to chain programs together to perform complex tasks. Avoid captive user interfaces. Configuration data stored in text.
  15. 15. 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 document.
  16. 16. 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 features.
  17. 17. 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 complex task.
  18. 18. 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.)
  19. 19. Configuration data stored in text : – Text is a universal interface, and many UNIX utilities exist to manipulate text. 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 and time.
  20. 20. References Eric Raymond: The Art of Unix Programming http://www.catb.org/~esr/writings/taoup/html/index.html Mike Gancarz: Linux and the Unix Philosophy; Digital Press, 2003, ISBN 1-55558-273-7 Wikipedia: http://en.wikipedia.org/wiki/Unix_philosophy Oregon State University: http://web.engr.oregonstate.edu/~traylor/ece474/lecture_verilog /beamer/linux_philosophy.pdf

×