% Why Learn the Unix/Linux Command Line and Shells? % Ian! D. Allen -- -- [www.idallen.com] % Winter 2016 - January to April 2016 - Updated 2019-03-01 02:59 EST - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] What is Linux and why do I care? ================================ Linux is an Operating System. Other examples of Operating Systems are the Android O/S that runs your phone (a Linux derivative), Microsoft Windows, and Apple OSX. The job of an Operating System is to manage the computer hardware so that multiple programs can use it. Examples of hardware that needs managing include memory, CPU, and peripherals. You don't want one program to cause another program to crash, and you want to share memory among several programs at the same time. The Linux operating system and its derivatives are found in very high-profile places such as Android phones, Google, Facebook, and the New York Stock Exhange. If you want to work with leading-edge technology, you need to know how to work with Linux. - [Linux Foundation Infographics] - [How Linux is Built (2012)] - [The Story of Linux (2011)] - [RevolutionOS: the Linux Story (old: 2001)] - [The Code: Story of Linux documentary (old: 2001)] -- turn on closed captions for full English - Log in to [lynda.com] and see "Chapter 1. Getting Started, What is Linux, and why should I use it?" in [Up and Running with Linux for PHP Developers]. Go under the "preferences" tab and turn on "Closed captioning" to see the words as well as hear them. You should be able to answer: - what is Free (as in "free speech") Software - what is Linux - Create your [lynda.com] account and watch just one part of [Learning Linux for PHP Developers] - **Ch.1. Getting Started** - What is Linux and why should I use it? 7m 14s\ This will explain what is an Operating System and why Linux is useful. - You should be able to answer: - where did Unix (from which Linux came) originate? - what do Unix systems have in common? - Linux and the people of [Mole City]. -- Humour, but true! GNU -- Gnu's Not Unix ===================== GNU stands for "Gnu's Not Unix", a modern rewrite of the Unix operating system and utilities from the 1970s. - GNU is a [Free Software Foundation] (FSF) project - GNU rewrote the Unix O/S as free (libre) software (the way it started out, before it was commercialized by Bell/AT&T) - The chief GNU architect was Richard Stallman (original author of EMACS) - The GNU O/S kernel, named HURD, hasn't progressed very far - but lots and lots of free/libre GNU utilities exist! A Linux "distribution" is a Linux Kernel bundled with GNU Utilities ------------------------------------------------------------------- You will hear people talk about "Linux distributions", which are packaged versions of the central Linux O/S kernel bundled and tested to work with with compatible utilities. - People took the working Linux kernel originated by Linus Torvalds and added all the Unix-compatible GNU utility software from the FSF. - Linux and GNU software is released as "free software" under the General Public License (GPL) that permits free redistribution. - "free" as in "libre" or "free speech", not as in "gratuit" or "free beer" FLOSS == Free/Libre Open Source Software - The GPL copyright license is often called "copyleft", since it is designed to *give* you rights and preserve rights, not take them away. - When you install Ubuntu, Red Hat, Mandrake, Caldera, Yellow Dog, Yggdrasil, Debian, S.U.S.E., Slackware, etc., you are installing a *distribution* ("distro") of Linux. - If you pay anything, you're paying only for the packaging, since Linus Torvalds makes no money from the use of his GPL kernel software and the FSF makes no money from the GNU utilities. - You can redistribute what you receive in a Linux distro for free (unless the distro includes non-GPL software). - The Linux programming API is compatible with the POSIX operating system standard API - source code that compiles for Unix/POSIX will compile on Linux Linux is Everywhere =================== - [Linux is Everywhere -- IBM] - Car - Kitchen - Supercomputers - Mobile Phones - The Cloud - Big Data - Real-Time Sports Analytics - Online Retail - Natural Language and Cognitive Computing - [Linux is Everywhere II] - Government - US White House, army, navy (submarines) - Munich, Germany, moves 15,000 PCs from Microsoft to Linux: [Munich Linux] - Education - Businesses and non Profits - Scientific Institutions Linux and Open Source Job Market ================================ : *Regardless of the health of the overall IT job market, open source is one area of the tech market that's always growing. In addition to traditional areas such as scripting languages and server operating systems, mobile app development, the cloud and big data offer new open source opportunities.* : *The many job openings being advertised at OSCON make the convention floor look more like a job fair.* : *I recently spoke to Samsung's Ibrahim Haddad who is the head of the company's Open Source Group in Silicon Valley. He is leading efforts to find the best Linux and open source sofware talent to help Samsung maintain its market position and shares with us why this is a priority for the company, how they're finding this talent and what they're doing to attract and retain open source developers.* : *Tech is in, but nowhere is the opportunity for career advancement and big financial reward more evident than in the Linux jobs market where salaries for skilled Linux talent are rising at nearly double the rate of other tech professionals.* : *Good news for job hunters in Android, Linux, and open source: "the most important thing they have in common is that they each require a fundamental understanding of Linux" and "technology professionals with these skills and expertise are being sought like never before"* Can't I just learn Unix online? =============================== Sure! You will find a video course by first logging in to [lynda.com], then see [Unix for Mac OS X Users] - This is an entire online Unix course, usable from school or from home (with your Algonquin student library card information)! - Doesn't cover Linux installation, booting, or writing shell scripts. - Also covers Macintosh-only Unix tools (last chapter) - See other Lynda.com courses for writing shell scripts. Some online courses ------------------- - - "Develop a good working knowledge of Linux using both the graphical interface and command line, covering the major Linux distribution families. Linux powers 94% of the world's supercomputers, most of the servers powering the Internet, the majority of financial trades worldwide and a billion Android devices. In short, Linux is everywhere." - - - or (Includes a 522-page free book!) - - - Command Line vs. GUI: Power Users need more than GUI ==================================================== > Sysadmin motto: "Anything worth doing will be done more than once." This is a short note I wrote on why even modern GUIs just don't have the power needed to handle repeated tasks. The original article appeared in the Ottawa Linux User Group whose mailing List you can find here A GUI user wrote: > There are plenty of examples. Take sending a message by e-mail for example. > No complex menu navigaion is required for that in a GUI, such as Evolution, > for example. You simply click on "New" fill in the form with appropriate > data, and click send. Okay, I just sent a file to one user. Now how do I repeat that and only have to change the userid, or only the file name, without having to "fill in the form" again (possibly making mistakes or forgetting exactly what I filled out in the previous form)? In a command line, I back up one line (one keystroke) and change "user1" to "user2" or "file1" to "file2" and push return. If I realize I want to do this a lot, I save that line in a script file and pass the userid or file name in as a parameter, so I only need type "./mailusers user3" or "./mailfiles file3". Say it's tomorrow and I can't remember exactly which files I sent to whom. My command line history tells me exactly what I sent and to whom and allows me to repeat what I did exactly, only changing the little bits I want changed. Say it's next month and I realize I'm always sending these emails to the same people, so I collect the command lines that do that and put them all into one script file that makes it all happen: "./doall" Say it's next year and I realize I'm always doing these things at the same time every month, so I put an entry in my crontab that will automatically run my "doall" script on the 15th of every month. Say I want my friend in Slovenia to be able to do exactly what I do. I send him my script file. What existing GUI lets me do that sort of thing? To summarize: - automatically saves the last thing I did - gives me keyword-searchable history of what I did - lets me edit any little piece of what I did and repeat it - allows me to save and parametrize what I did so that in future I only have to specify the little bits that change - lets me group a common series of things I do into a repeatable script so that it's easy to do all those things in that order - lets me run anything unattended (via crontab or other background scheduling system) - lets me pass my saved and customized actions to another user, who can also customize and modify them further > You're talking about taking an action that you can repeat later with the > same parameters, or parameters you can easily change. So, write the > software so that it can save and retrieve parameters for a future session > without using a complex menu. My command line doesn't require me to rewrite any applications. I can parametrize and run all the applications unchanged. What existing GUI lets me do these things, all of which I do *a lot*? "Anything worth doing will be done more than once." References: Point-and-Grunt and Free Software Ideals ======================================== - Eben Moglen on the GUI as a catastrophe - - \[2m30s\] "I wrote an internal appreciation about that computer \[the Apple Lisa\] in which I said this is a catastrophe. This is the end of language in relation to computers. This is the implementation of the"cave man" interface: you point, and you grunt. And if we reduce the interaction between human beings and computers to pointing and grunting, then we miss the role of language in the evolution of human mind and human consciousness. Language is what makes our brains bigger. If we don't use languages to relate to computers, neither their brains nor our brains will grow in the way that they are supposed to grow." -- Eben Moglen, [Free Software Foundation][1] - Bruce Byfield on software freedom: - "\[...\] in the rush for market share, many people seem to lose sight of the fact that the goal of GNU/Linux and free software is not popularity in itself, but the wide acceptance of a set of ideals. At its most basic, free software is about helping users gain control of their computers so that they can participate unhindered in the digital conversations of the networks and the Internet. It's about installing software freely, rather than being dictated to by the manufacturer. It's about using your computer the way that you want, instead of ceding control to lock-down devices installed by software vendors without permission on your machine." -- Bruce Byfield, http://itmanagement.earthweb.com/osrc/article.php/3733286 *(no longer online)* Getting Useful Work Done ======================== > The designer of a program that provides a graphical user interface must > anticipate all the possible ways in which the user will interact with the > program and provide ways to trigger the appropriate program responses by > means of pointing and clicking. Consequently, the user is constrained to > working only in predicted ways. The user is therefore unable to adapt the > graphical user interface program to accommodate unforeseen tasks and > circumstances. In a nutshell, that's why many system administration tasks > are performed using the shell: system administrators, in fulfilling their > responsibility to keep a system up and running, must continually deal with > and overcome the unforeseen. > > -- Bill McCarty, "Learning Debian GNU/Linux", Chapter 13 Mastery of Unix =============== > Mastery of UNIX, like mastery of language, offers real freedom. The price > of freedom is always dear, but there's no substitute. Personally, I'd > rather pay for my freedom than live in a bitmapped, pop-up-happy dungeon > like NT. I'm hoping that as IT folks become more seasoned and less > impressed by superficial convenience at the expense of real freedom, they > will yearn for the kind of freedom and responsibility UNIX allows. When > they do, UNIX will be there to fill the need. > > -- Thomas Scoville, "The Elements of Unix Style: Unix as Literature" > http://www.thomasscoville.com/PCarticle.html *(no longer online)* In the Beginning was the Command Line ===================================== > Back in the days of the command-line interface, users were all Morlocks who > had to convert their thoughts into alphanumeric symbols and type them in, a > grindingly tedious process that stripped away all ambiguity, laid bare all > hidden assumptions, and cruelly punished laziness and imprecision. Then the > interface-makers went to work on their GUIs, and introduced a new semiotic > layer between people and machines. People who use such systems have > abdicated the responsibility, and surrendered the power, of sending bits > directly to the chip that's doing the arithmetic, and handed that > responsibility and power over to the OS. This is tempting because giving > clear instructions, to anyone or anything, is difficult. We cannot do it > without thinking, and depending on the complexity of the situation, we may > have to think hard about abstract things, and consider any number of > ramifications, in order to do a good job of it. For most of us, this is > hard work. We want things to be easier. How badly we want it can be > measured by the size of Bill Gates's fortune. \[...\] > > In other words, the first thing that Apple's hackers had done when they'd > got the MacOS up and running--probably even before they'd gotten it up and > running--was to re-create the Unix interface, so that they would be able to > get some useful work done. At the time, I simply couldn't get my mind > around this, but: as far as Apple's hackers were concerned, the Mac's > vaunted Graphical User Interface was an impediment, something to be > circumvented before the little toaster even came out onto the market. > > -- Neal Stephenson, "Cryptonomicon", "In the beginning was the Command > Line" -- | Ian! D. Allen, BA, MMath - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [www.idallen.com]: http://www.idallen.com/ [Course Home Page]: .. [Course Outline]: course_outline.pdf [All Weeks]: indexcgi.cgi [Plain Text]: 010_why_linux.txt [Linux Foundation Infographics]: http://www.linuxfoundation.org/news-media/infographics [How Linux is Built (2012)]: http://www.youtube.com/watch?v=yVpbFMhOAwE [The Story of Linux (2011)]: http://www.youtube.com/watch?v=5ocq6_3-nEw [RevolutionOS: the Linux Story (old: 2001)]: http://www.youtube.com/watch?v=iBVgcjhYV2A [The Code: Story of Linux documentary (old: 2001)]: http://www.youtube.com/watch?v=XMm0HsmOTFI [lynda.com]: http://algonquincollege.com/onlineresources/mobileStudent/lynda.htm [Up and Running with Linux for PHP Developers]: http://www.lynda.com/Apache-tutorials/What-Linux-why-should-I-use/158372/178047-4.html [Learning Linux for PHP Developers]: https://www.lynda.com/Apache-tutorials/Up-Running-Linux-PHP-Developers/158372-2.html [Mole City]: http://www.youtube.com/watch?v=aCVGbDf6Uws [Free Software Foundation]: http://fsf.org/ [Linux is Everywhere -- IBM]: http://www.eweek.com/enterprise-apps/slideshows/from-clouds-to-cars-to-kitchens-linux-making-an-impact-everywhere.html [Linux is Everywhere II]: http://malaysiandigest.com/technology/482848-linux-is-everywhere-we-show-you-exactly-where.html [Munich Linux]: http://www.linuxvoice.com/the-big-switch/ [Unix for Mac OS X Users]: http://www.lynda.com/Mac-OS-X-10-6-tutorials/Unix-for-Mac-OS-X-Users/78546-2.html [1]: http://www.fsf.org/ [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/