Week 31 Lesson Plan Addendum Linux Display a screenshot of Linux on overhead while giving this lecture. History In the early 70’s, a gentleman by the name of Ken Thompson got in trouble at his place of employment (Bell Labs) for playing games on a company computer. He survived and remained employed but was hooked on the game so he asked for and was granted access to an older machine that didn’t work too well. He did not have an operating system so he wrote his own OS and called it UNIX. It is written for large mainframe computers and usually does not have a GUI. It was a hardware independent OS and could run on any machine (that is called portability). In 1991, in Helsinki, Leonard Torvald took the OS UNIX and pared it down to be able to use it on a PC. Linus was his nickname and so he called his invention, Freak, but was later urged to change it to Linux (as a combination of Linus and UNIX). Mr. Torvald believed in Open Source software and made his source code available to anyone that wished to have it. The only requirement was that he insisted that anyone that modified or improved the OS would have to provide it free to others in keeping with the ideals of the Open Source idea. Linux has some advantages and drawbacks Advantages Free Looks and acts very similarly to a Windows Environment No viruses – stable –well written High Security Open source Very Fast operating and loading Runs on older equipment very well It is multi-user (several hundred users can be supported) Multitasking is available When users log on they can run any application Linux worth thousands on your paycheck and resume Disadvantages Not supported – no one to call Not intuitive to use when getting into the guts of the engine Limited applications have been written (changing as more and more are available) Hardware support for new devices is limited – game of catch-up
When to use Old computers with limited memory Servers Apache is most well known server Almost all banks and government and real estate use for security robustness Where to get Online many, many different versions with new ones coming out all the time Try www.linux.org for starters Do Linux Funny Quiz Note: a Mac version is also available Some companies have started with the basic core Linux Kernel (core) and written value added packages to use with the core. Some companies have bundled this with some documentation for which they charge – technically the software is still open source and hence free but you are paying for the documentation. One company that does that is Redhat and they made millions. Redhat and Novell have started offering their server version of Linux for a price again for the documentation. An Aside: GNU means GNU not UNIX – called a recursive acronym Have Students load Linux and explore options Lecture #2 Linux File System Linux uses what is called an extended file system called EXT2 (the 2 means version 2) The file system is similar to the structure of Windows in that it is shaped like an upside down tree with directories and subdirectories and files all cascading under the main directory called root. Of course the directories are named different things but the structure is the same. Linux has directories such as: /etc which contains the configuration files /bin that contains the binary files /mnt which contains the devices that are mounted /dev which contains the device drivers and commands /boot for the boot files /home for the users home directories /lib for the storage of library subroutines /opt for optional software packages /sbin for system commands /tmp for temporary storage /usr is a secondary hierarchy of the file system /var for variable data
As stated before the source code is readily available. (Show code on board). You can modify this code – it is written in the C programming language. You must distribute it free of charge under the GNU license that you agree to by downloading the software. Even your modifications and add-ons are to be distributed freely for comment and correction. (note: after writing the code, you must use a compiler to change your written program into machine code. One cannot un-compile a file. Any books or directions that you manufacture (including the cost of copying CD’s are available for charge (that is how Redhat made its money). Also if you make a server version, you are free to sell that version of the code. Step by step instructions for driver development and other code developer assistance is available in many forms online and through books written on the subjects. Go to www.linux.com for all your Linux needs. Downloaded files will usually have the extension of “filename.iso”. They may however have any number of extensions including tar, rar, zip, bz2,l or rpm. RPM stands for Redhat Package Manager but there are several other types as well. These files will need to be un compressed using programs such as WinZip, WinRar, or Izarc Instructions for ISO files: After downloading an ISO file, some programs will have an auto run file that will decompress the image for you but if yours does not have the un compressor, you need to use a program such as Izarc, to open the file to a folder. You will need to extract the files because they are compressed into a folder of your choice (do not use the folder they recommend). The best way to get a feel for Linux is to load it on a machine and play with it. Get to know the command and directory structure, etc. (just like you did for Windows when you first started) Commands who lists users cat concatenate – view cd change directory chmod changes modes (permissions) on file attributes clear clears the screen cp copy grep global reporting ifconfig just like ipconfig in Windows kill stop ls list like dir ls –al shows all man manual (help files) mkdir make directory |more show one page at a time mv move ping packet internet groper pwd present working directory – where you are in the directory tree reboot reboots eject spits out cd rm erase files rmdir removes directory vi visual editor bash enter the bash shell alias create user friends aliases head print first ten lines of a filename tail print last ten lines of a file vi Editor (note – vi is not capitalized) Similar to notepad used to edit files in the Linux environment. Some commands useful in vi are Alt – deletes the word to the right of curser vi filename – edits or creates the file filename All commands are case sensitive W is move to home position dw is delete the next word Save the file using and exit – note must use the colon before the command :exit Note the line numbers PICO is another recently invented line editor Nano is another editor program. Linux uses executables known as shells which are similar to Windows environment. A shell runs the internet browser, a shell runs the editor, etc. – top level shell is called bash – which stands for Bourne Again Shell (named for Robert Bourne part of the Unix build team – he also invented ctl-alt-del). Unix and Linux uses redirection as very powerful way to manipulate data and files. Demonstrate on board redirection by writing the command: cat /etc/shells > newfile <cr> or append /etc/shells > oldfile – this commands adds the contents of newfile to the end of the oldfile or print newfile > lpt0 Go into the permissions and using change mode to alter the permissions. chmod 777 filename cr chmod 622 filename Explain about decimal 7 is 111 in binary and the correspondence to the rwx displayed by the ls –al command. GUI’s in Linux environments are called Xwindows Two main types are GNOME – GNU Network Objects Model Environment KDE Knoptic Desktop Environment Use the command session to switch between desktops startx commands initials the desktop (GNOME or KDE) if available To start the GUI automatically – you have to edit the file /etc/innitab run level 3 is the shell but run level 5 is the GUI go to the line that says id: something, something and make sure it reads id:5:initdefault Superuser After starting Linux you need to log in as a user and then give root a password Then login as su root using the password you gave it Or use sudo filename to execute to bypass password Sharing is done by calling the process – exporting To share your documents or folders, you edit the /etc/exports file. The format of the entries is Filename:/path for example: maple:/pub USE LINUX TABS ON IE FOR EXPLANATION OF LINUX. Linux Quiz Chapter 3 – Open book. |
Our Programs > Computer Technology > Computer Service Technician I > Lesson Plans > Week 31 >