~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ GNU / Linux , A Neophyte's ~~~~~ ~~~~ Introduction ~~~~ ~~~~~ Version 2.1 5/1/99 ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _________ This document may be reproduced in whole, or in part, so long as the reproducer does not stop other people from reproducing it again, and gives Guse Industries original credit, but you can add or modify it in any way you see fit. _________ -------------------- - Table Of Contents : -------------------- 1. What is GNU Linux? a. distributions 2. Should I use GNU Linux? 3. The Basics a. Where can I get it? b. Shells c. Basic commands c1. pipes d. File Permissions e. File System 4. Resources a. sites b. books 5. About This Document _________ 1. What is GNU Linux? Before I explain this, I want to say something to those of you who do know what it is: when I say GNU Linux, I don't mean only the Debian GNU Linux distribution, GNU Linux is the proper name, seeing as how the GNU project created most of the utilities included with nearly every Linux flavor. Linux is the kernel. Now, on to the rest of you. The GNU project (Pronounced guh - new, an acronym for GNU's not Unix) originally set out to create an open source Operating System, similar to UNIX, a very powerful OS, which was not free or open source. The project has been a success for the most part, GNU has created many things, not the least of which include the bash shell, the GCC and G++ compilers, GNU Emacs, and much more. The Linux kernel, or core of the operating system was created by Linus Tsorvals, and newer versions are being released. Hence we get the name GNU Linux, commonly called Linux. Linux has a reputation for technical excellence, and for stability, because it's open source, which means that it must come bundled with source code, or the original instructions written in a programming language, many people view the source code, find bugs or flaws and report them or fix it and post the result on the Internet. This open source way of doing things makes it popular among computer hobbyists, hackers, network specialists, and system administrator because of it's flexibility. a. Distributions There are many Flavors, or distributions of GNU Linux, each distribution gives it's own software with the GNU utilities and the kernel. The common ones being Debian, SuSE, RedHat, Caldera, and Slackware. I think that all the distributions are excellent. _________ 2. Should I use GNU Linux? This depends on what you want to do with your computer. For example, if you are looking to start to learn to program, and learn about networking, GNU Linux is an excellent place to start. But, If you're looking for an OS that is very easy to use, Linux might not be for you, although there are GUIs (Graphic User Interfaces) like KDE and GNOME, the fact is that they are, sadly, harder to use than Microsoft Windows (TM MicroSoft). By this, I mean, if a computer illiterate person sat down with a Linux box running KDE, he/she would most likely have more trouble learning to use it than if he/she was using a MS-Windows box. If you're looking to learn and expand your knowledge, then Linux might be right for you. It is free so try it out and see if you like it (just back up your data first). Also, GNU Linux has been ported to many hardware architectures. Oh, yes, Linux can run on the same box as Windows or DOS. _________ 3. The Basics a. Where can I get it? You can retrieve the distributions via FTP, for instance, Red Hat's FTP server is ftp.redhat.com but there are many mirrors, see the web sites of each flavor for information on FTP, installation instructions, and mirrors. You can also get some flavors from CheapBytes (http://www.cheapbytes.com) for minimal amounts of money, you can have everything you would get via FTP burnt to a CD. Red Hat is selling packaged versions of it's flavor with manuals, and installation books at retail stores such as Best Buy. b. Shells Shells interpret commands and send them to the kernel for execution, among other things. If you are familiar with MS-DOS (tm Microsoft), then you may know that command.com is the DOS shell. Common shells include.. ------------- - fig. 3.b.1 : ------------- _______________________________________ Name Command ------ --------- the Bourne shell...............sh the C shell....................csh the expanded C shell...........tcsh the Bourne Again shell.........bash the Korn shell.................ksh the Public Domain Korn shell...pdksh the Stand Alone shell..........sash the Z Shell....................zsh _______________________________________ These won't be on every system, but those are the popular ones. Most shells also give you the ability to create Shell Scripts which are kind of like MS-DOS batch files only much, much more powerful. I may someday create a bash shell scripting section. c. Basic Linux/Unix Commands When you first start out on Linux, you may be in a state of asking "what now?" well, these are some of the basic commands you should know right away. I'm not going to go into huge detail about what each of the commands do, just look in the man pages, RTFM, and remember, Unix and Linux IS case sensitive. *NOTE - the ^-----'s are arrows, believe me, it's easier to read that way. ------------ - fig 3.c.1 : ------------ ____________________________________________________________________ Command What it Does --------- -------------- cat ^------------------ Concatenates and displays a file to screen cd ^------------------ change working directory chown ^---------------- changes ownership of a file chmod ^---------------- change permissions of a file cp ^------------------- copy a file/directory diff ^----------------- Displays the differences between two files or directories echo ^----------------- display on standard output, and print arguments ed ^------------------- a very old, and bad text editor elm ^------------------ an e-mail client emacs ^------------------- a very powerful editor exit ^----------------- logout of your terminal gunzip ^--------------- uncompress a file with a .gz extension gzip ^----------------- compress a file and add a .gz extension jed ^------------------ also a bad, weak editor joe ^------------------ a slightly better editor kill ^----------------- kills a specified job ls ^------------------- view files/directories in working directory man ^------------------ get manual page for given command (like help) mkdir ^---------------- make directory mount ^----------------- mount a block device with a supplied file system mv ^------------------- move a file/directory passwd ^--------------- change a user's password pico ^------------------- an editor that is easy to use, but weak pine ^----------------- an e-mail client pwd ^------------------ Print Working Directory rm ^------------------- delete/remove a file rmdir ^---------------- remove empty directory shutdown ^------------- shutdown system useradd or adduser ^----------- add a user account vi ^------------------- very powerful editor, which is found on nearly all UNIX systems ___________________________________________________________________ c1. Pipes a pipe is an output redirector, which can pass the output of a program to another program or text-file, the character | is used to string the output of a certain command to another program. EX: cat /home/roy/goo.cpp | more -- this tells the cat command to display the contents of /home/roy/goo.cpp to the more command, which prompts you to hit space whenever the screen becomes filled with ASCII characters, so the text doesn't just scroll by uncontrollably. You can do many things with pipes, such as write the output of a command to a text file for later inspection, and so on. --For help and syntax for these commands, refer to the man pages by using the man command as listed above. d. File Permissions File permissions govern who can read, write, and execute files. this will be as if I just typed this in the shell, what I type will be on lines after the '$' prompt, and my comments are before the '/*' and '*/'. ------------- - fig. 3.d.1 : ------------- _____________________________________________________ $ls -l /* ls -l gives you the 'long directory'. The long directory lists file permissions */ total 2 drwxrwxr-x 16 guse guse 1024 Apr 11 14:28 tut1 drwxrwxr-x 2 guse guse 1024 Apr 11 14:28 tut2 ______________________________________________________ Now, let's learn about permissions, shall we? We'll examine the file permission lines first. ---------- fig 3.d.2 : ---------- ___________________________ The file permission line is what you see at the very front of every file viewed with ls -l. Here is the anatomy: 1 2 3 4 - --- --- --- ___________________________ Line 1 tells us if we are viewing a directory, if it is a directory, it will have a d in that place, if not, there will be a - . line 2 is the User access, so if line two says: rw- than the user has permission to Read, and Write to the file, but not Execute it. Remember r = Read ability, w = Write ability, and x = Execute ability. In UNIX, the user belongs to a group, and the second line tells about the group the owner of the file is in. So, if line 3 says r-- than the user group the owner belongs to has the ability to read the file, but cannot write to the file, or execute it. Line number 4 is other, this means people other than the owner, and the group the owner belongs to, so if line 4 read: rw- than other could Read and Write to the file, but not execute it. Now we'll cover the rest of the long directory: ------------ - fig 3.d.3 : ------------ ____________________________________ $ls -l total 2 drwxrwxr-x 16 guse guse 1024 Apr 11 14:28 tut1 drwxrwxr-x 2 guse guse 1024 Apr 11 14:28 tut1 /* | | this is the owner--+ | this is the group---------+ */ ____________________________________ e. File System The file system is a broad topic, but I'll focus on just the basics. The UNIX file system is set up like a tree, everything branches out from the root directory, '/'. So, well look at a diagram of the file system, a very basic tree diagram, a real GNU/Linux system would have many more directories than this one. ------------ - fig 3.e.1 : ------------ ________________________ /home/bob/my_novel/my.novel.html | /home/bob/my_novel/ | /home/judge_judy/my.case-notes.text | | /home/bob/ /home/judge_judy/ | | /usr/doc/about.sh.gz +-+ +-------+ | | | +------+ /home/ /bin/ | | | /usr/doc/ +--+ | | | | /usr/ | +--+ | +-----+|+--+ ||| / ___________________________ While it may not look at all like a tree, it should give you the basic idea. If it didn't, that above computer has these directories: ------------ - fig 3.e.2 : ------------ _________________________ the above system has the directories: / /usr/ /usr/doc/ /bin/ /home/ /home/bob/ /home/bob/my_novel/ /home/judge_judy/ and these files: /home/bob/my_novel/my.novel.html /home/judge_judy/my.case-notes.text /usr/doc/about.sh.gz __________________________ Obviously that isn't a very accurate picture of a system, because there isn't even the basic low-level kernel files, so there is no way the system would be able to function, but you get the idea. _________ 4. Linux Resources a. -sites- http://www.ssc.com/lg/ ~ Linux Gazette, it's free http://www.redhat.com/ ~ RedHat Linux - Red Hat is a flavor, geared at an all in one package. http://www.caldera.com/ ~ Caldera is a Linux distribution, focusing much on business http://www.suse.com/ ~ SuSE is a great distribution of Linux http://www.slackware.com/ ~ Slackware is a major distribution also http://www.debian.com ~ Debian Linux is also a distribution http://metalab.unc.edu/mdw/linux.html ~ Linux Documentation Project, great HOW-TOs, very recommended http://www.gnu.org/ ~ GNU http://www.linuxlinks.com/ ~ lots of Links related to Linux http://www.linuxhq.com/ ~ Linux Head Quarters http://www.linuxworld.com/ ~ Linux World http://www.linux-center.org/en/ ~ Linux Center http://linuxgames.com/ ~ Linux Games http://slashdot.org/ ~ SlashDot http://www.freshmeat.net ~ Fresh Meat, Linux apps b. -books- _Linux User's Guide_ by Larry Greenfield ~ It teaches you the useful commands so you can help yourself, I very much recommend this book. _Linux Unleashed_ ~ Huge book, great. _RedHat Linux Unleashed_ ~ a good book for learning Red Hat Linux, but doesn't teach you many commands. _Learning the bash Shell_ by Cameron Newham and Bill Rosenblatt ~ good book, teaches you Linux/Unix commands in the bash shell, my favorite shell. _UNIX in a Nutshell_ ~ good reference, and there's a Lemming on the cover design, reason enough to buy it The books that follow pertain to programming, but I thought I'd include them anyway, since many people are either attracted to Linux/UNIX because they are programmers, or because they want to learn to code. _Teach Yourself C in 24 hours_ by Tony Zhang ~ an absolute neophytes guide to the C language, provides good intro to C in general _Assembly Language Step By Step_ by Jeff Duntemann ~ old, but good 8086, newbies to Assembly only though _C++ In Plain English_ by Brian Overland ~ a good book, I'm out of adjectives, so it's a good book. _Programming Perl_ by Larry Wall, Tom Christiansen, & Randal L. Schwartz ~ Perl is useful in database management, text manipulation, and cgi scripting, among other things. _Learning Perl_ by Randal L. Schwartz & Tom Christiansen ~More of a tutorial way of learning Perl than _Programming Perl_ ___________________________________________________________________ 5. About this Document This document is to be taken as merely an introduction, not a one stop resource for Linux information, obviously. It is for the absolute beginner. We cannot include everything about GNU/Linux without writing an entire book, that is why I recommended books and HOW-TOs. I've noticed that there is a lot of documentation on Linux, but the authors expect you to already know the very basics, though some books have a chapter on the very basics. _________ EOF