2011-08-28

Linux: A Beginner's Guide, Introduction

Introduction:

I realized only a few moments ago that in all of the years that I have been using Linux I have taken for granted that I never had to learn Linux after years of using another OS.  I never started with my hand being held by my parents, some coding guru, or Bill Gates's team of developers.  So realistically, I have no concept of the difficulties that a user of what I like to refer to as that "lesser" OS has to go through in order to effectively migrate over to Linux.  When I say that I have no concept of these difficulties, I don't mean that I don't know what questions they have, I've spent enough time in IRC and on forums contributing my little bits of knowledge long enough to know the top questions.  What I mean is, I don't understand the frustration, the anxiety, or the overall feelings brought on by the stress of switching OSes.

This series of tutorials and reference sources is my way of taking the highlights of my twenty years (at the time of this post) of *NIX experience and giving some of it back to the community in a way that I believe has not quite been done.  Sure, wikis and how to's abound on the internet, but they either are written for system admins, developers, or masochists... or they don't go far enough and are written with the assumption that you are a 3 year old who doesn't know how to read much less bash your face into your keyboard.  It is my intent to rectify this mistake.

Required:


First, let's take a look at the things that you need to know before you venture off into "Linux Land".


  • Linux is not, is nothing like, and will never be, anything like Windows.
This is very important to understand! In the twenty years that I have been using IRC (Internet Relay Chat) the number one question that I am asked is, "Is Linux like Windows?"  In the sense that it's also an Operating System? Yes.  But this isn't what people mean when they ask this question, what they mean is; does it look the same? does it use .exe files? do I have to learn anything? and basically, is it automatic? I first was asked that last one when I was 10 years old and had just learned that you had to press the clutch down in a stick shift...

Linux can look the same (or damn close to it!), it can use some .exe files (with Wine), and there is a whole ton of stuff that you need to learn (especially if you want to do the first two things mentioned).  Linux can do damn near everything that Windows can do, some of it even better, but it does it all very differently.  Some of these differences the average user won't ever see, some are so blatantly obvious that the average Windows user takes one look and runs away screaming.  You may think that I'm exaggerating, but I kid you not, at the age of 9 I had a teacher run out of the computer lab screaming because she saw me typing in a terminal window (gotta love live floppy systems) and thought that I had destroyed a precious hard drive.

Know this, there is a learning curve.  This curve is made more drastic by the fact that you've spent, most likely, years using a completely different type of system targeted specifically for a completely different demographic of user.  In general (though this is not as true today) Linux is not targeted at anyone in particular. It is an absolutely open OS, it is meant to be whatever you want it to be.  This undoubtedly brings to mind some token geek sitting in his mother's basement hacking away in what looks to be some techno-punk command center while in his underwear.  But being completely open means that you can make it the way you want it.  If you want Linux to be automagic, you can make it that way.  If you want it to spit lines of code all across the screen, you can do it. If you want it to be more secure than it already is, there are settings and programs that you can modify to do that for you.  

  • Just as God is credited with being the all giving, all taking, all knowing, omnipresent, omnipotent, creator of all that is, has been, and will ever be; so to does Linux look at you. 
I hinted at this a little recently, but now I get to come out with it; Linux thinks that you are God with a capitol "G" ("R").  Linux looks at you with open arms and waits for the day when you will return to properly administer the system to perfection, destroy the matrix, free Flynn, and send the evil of the system on a one way ticket to being non-existent byte code.  All you have to do is log in as a particular user.  Root.

Root has got to be one of the most difficult things about Linux for any user to come to terms with.  To illustrate this point, I want you to do something.  Assuming that you are on a Windows system, and also assuming that you are using an Administrative account, I want you to navigate your way into C:\Windows\ and find KERNEL32.EXE.  You there? Good.  I want you to right-click on that file and then click "Delete".  I'll tell you what's going to happen, just in case you didn't know already; you're going to be met with a nasty dialog box and a scary sound that will tell you basically "Permission Denied".  You'll be able to click "Okay" and the box will go away and nothing will happen.  The file is still there.  Know why? Because there was some person at Microsoft who came up with an idea that involved protecting you from yourself.  You can't delete KERNEL32.EXE, even as an Admin.  There are ways to do it, but they are outside of the scope of at least this article :)

Now in Linux I can destroy my kernel.  In fact, I can take down my whole system in about 30 seconds with a single command: 

rm -rf /*

PLEASE NOTE: The above command while run as root will DESTROY your system! It is a mass deletion command. I will cover the use of "rm" in a later tutorial, for now, DON'T TOUCH IT!

That's right, Linux is so trusting of root, that it will allow you to sacrifice your system.  It's that willing to please you.  That is your right as root. You have the power to give and to take away.  Understand this now, let it sink in, take a day or two off if you need to and focus on just this one thing: Linux gives you absolute power over your system.  What does this mean to you? Everything!  It means that you should treat the running of your system as a privilege, that you should take your system seriously, and that you must treat your system as you would treat your first born child if he/she were born 4 months early and breathing through a tube.  Long-time Linux users love their systems, not love as in "OMG I LOVE Lady Gaga!" No, I mean:

"See, how she leans her cheek upon her hand! 
O that I were a glove upon that hand, 
that I might touch that cheek!"
                                         - William Shakespeare, Romeo and Juliet, 2.2

We Linux users love our systems this way because we are root.  We cannot go back to another OS that doesn't give us root once we have understood the responsibility and the power of root because we understand the responsibility and power of root.  We get that guilty feeling as if we had just betrayed our one true love to the ninth circle of hell.  

  • Google is a search engine.  It knows everything.
I want you to know something, it's a secret: I absolutely, positively, undoubtedly, always have, still do, and always will, LOVE to repeat myself.  NOT!  I cannot tell you how frustrating it is to answer the same question everyday, all day, for years even though there is a very simple answer (that is often-times blatantly obvious, even to a layman) that is readily available with a very simple search term in a very easy to use and common search engine.  Google is your friend, Google knows more about you than you do, it knows all, it has talked to alien life on other planets in other universes in the 10th dimension and beyond.  The answer is there, all that you have to do is enter the proper word(s).  In fact, you may have even found this blog using Google, which is convenient because this blog is hosted by Google.  Just as you look up video games that your kid might like for Christmas by using Google, so you can use Google to find answers to questions about Linux.  

Read.  Read.  Read.  Read.  Read!  Reading is one of the things that separates us from the other animals on this planet.  It is a great way to learn.  There are tons of docs, manuals, How To's, Tutorials, and various other things that tell you exactly what to type (or copy and paste) in order to fix your issue no matter what it is.  As fractured as the Linux community appears to be, the one thing that all Linux users have in common is that we read each others' work.  I'm a Sabayon Linux user, but I cannot tell you how many times I venture over to the Arch Linux Wiki to find out how to do something in Sabayon that might not be that well documented, out of date, or just plain non-existent on the Sabayon Wiki.  There are things that I do in FreeBSD that I go to the Gentoo Wiki for, and FreeBSD isn't even Linux!  Documentation can save your life and your system, especially well written documentation.  Searching on Google is a free tool that you have at your disposal.  Use it to search for answers to your questions first, and you will be that much closer to being considered a truly competent user of any OS, but especially Linux.

  • Linux is supported by users.
Some people don't understand this statement, but it's on every single Linux site that I have ever seen.  Linux is supported by the users who use it.  Regular people.  My kids are six and seven years old, when asked by a neighbor of mine what I was doing, my daughter quickly chimed in "He's installing stuff."  "How do you know?" my neighbor asked.  "Because silly, his terminal is red, that means he's root, and root installs stuff!" was my daughter's answer before running off to play with my neighbor's daughter.  My daughter just taught an adult a very basic concept, "Root has power".  She just provided support to someone.  Now that is a very simple description of what support by users means, but both of my children started on Linux from the time they were old enough to know that buttons were things that you pressed (age 3 is when they sat on my lap and learned to type their usernames on my then awesome sauce laptop running Gentoo).

Sure, some of these "users" are programmers, developers, hackers, IT professionals, system administrators for large companies, and all around geniuses.  But they are also kids, teenagers, students, starving artists, musicians, high school dropouts, and average joes who want to help you.  You know what the best part is? They will provide ground up support to you for free.  I was twelve years old when I was sitting in IRC talking to some person who I met on the internet about their botched Debian Linux install.  I was determined to keep them from having to do a clean re-install of their OS because they said they heard that if you broke Linux you didn't always have to re-install it like with Windows (or Mac OS).  I sat there for 10 hours on a Saturday night walking this person through every single step of how to get a new kernel installed manually.  Back then, there was no binary kernel garbage that we have today.  Oh no! This was old school; downloading source packages (tarballs), unpacking to the directory, verifying md5sums, make, make menuconfig, going through each and every menu (there are a TON), selecting the appropriate items for his system, saving the config, make deps, make install, tarring up the system map, tarring up the kernel, tarring up the initial ram disk, moving it all to the boot partition, configuring LILO, configuring modules and their dependencies, re-writing shell scripts, re-writing config files, re-mapping his hard drives, re-configuring his network settings, adjusting his text editor defaults, and installing a graphical user interface (GUI).  

You know what was really funny about that?  He asked me if my username was my real name, I said that part of it was.  He said that he recognized it from somewhere, I asked "where?", he said from work.  Turns out, I knew the guy.  He was the IT guy at my mom's office (she was a translator) and I had just helped him fix what his team hadn't been able to fix in a week, which was a big deal because this particular computer that I had helped fix was the master backup server for all of the client disk image backups on their network.  Because we were able to save him from a re-install, he now had the chance to keep all of the data that he would have potentially lost (all of the disk image backups for the company computers).  My wife can attest to the fact that I spend a lot of time on my computer, sometimes days at a time with no sleep.  Guess where I am just like so many other millions of Linux users; that's right, in IRC answering questions (among other things).  Keep that in mind as you learn to use Linux.  

  • Linux is a community.

This is another hard one for people to grasp.  Linux is a community, a family, a close-knit group of users.  We may use different distributions, have different political views, and various other idiosyncrasies, but we have one thing in common: we are all using Linux.  It's like when I was in the Army and had to work with various groups from Navy  S.E.A.L. teams to Marine Force Recon and Air Force Para-Rescue.  You get us all together in a bar and there is going to be one helluva drunken brawl with insults being thrown around as well as broken bottles.  But get us out on a mission together and you would swear that we were all born from the same womb.  We'd die for each other without thinking twice and without any regret.  It's very similar between Linux users.  We each have our favorite distribution, package manager, system management techniques, etc.  We each give each other crap in our own ways (although we all generally agree that making fun of Ubuntu users is really fun :P  ) but you get us in IRC where one in our fold needs help and just watch as Gentooers, Arch users, Sabayon users, Fedora users, and even Ubuntu and Mint fanboys come together to tackle someone's issue.  One of us will be researching, another going through diagnostics, the other checking config files, another trawling Google for how to fix the issue in a GUI, another taking a portion of a Python program and converting it into a usable BASH script to fit the issue, and so on.  It is a thing of beauty!  

When you become a Linux user, you are joining a brother/sisterhood of users who believe in their OS.  They hold themselves and their software to a higher standard, but retain their humility.  To join the ranks of the Linux users you have to understand the community.  The community is there to help, to progress, to advance, to nurture, and to keep the community safe.  It is ever-evolving, ever growing, and ever sustaining itself.  You are joining a collective of life minded individuals who in their own ways are working to make the world a better place.  We promote the indie developer, we contribute code to projects, we are always learning, always refining, always doing something that helps as many people as possible.  Once you see the Linux community in action, you can't help but want to be a part of it.  I am 27 years old and have been using Linux since that fateful day when Linus Torvalds kernel was released to the public on a computer that my mother handed to me with no instruction except "Learn to type."  To this day I am amazed at the wonderful things that the community does every single day.  I highly recommend that you start reading some forums, some wiki articles, and hop into some Linux distro IRC channels while you are learning about Linux.  


You are still here:

If you are still reading this article Bravo!  You are ready to take your first steps into learning the basics of how to use Linux.  While I'm writing up the next article, here is your assignment: Use Google to look up various Linux distributions.  Find a distro that fits your personality.  Back when Linux first started to branch into distributions we called them "Flavors".  Find your flavor.  Look for something that looks the way that you want it to.  Something that when you read the "What is ?" page you agree with.  You may be the type of person who likes absolute control, who values function over form, aesthetics over all else, simplicity, elegance, etc.  Find YOUR flavor, if you are feeling brave, boot it up on the CD/DVD/USB and play with it live.  If you are feeling really brave, install it to a spare partition.  Exceptionally brave? Install it OVER your Windows install and dive in (backup first, not backing up does not make it into "brave", besides, it's good and safe admin practice).  Read about what IRC is and join your distro's channel.  Read their forums, their wiki articles, blogs, etc.  Do your research!  This is a big step, which distro you choose will define you to the community and to yourself.  It can be the difference between getting a successful start or being done before you began.

I will not do as other blogs and list distros for you and give you my opinions of them.  I take choosing a Linux distro as being a very important and very personal decision.  It's kinda like asking a girl out for the first time.  You have to practice what you are going to say, what you're going to where, which cologne to wear, and where on earth you plan on taking her out to.  You're about to choose your date for at least the next month.  I say the next month because when you pick a distro, you don't really know it until you've dated it for a while.  You have to use it, maintain it, break it, and make up with it before you really know whether you want to stick with it or move on.  As with women (and men), there are plenty of (Linux) fish in the sea.  Choose carefully where you start.  Everyone remembers their first kiss, some of us remember it fondly, some people wish that they could forget about it.  Choosing your flavor is the same thing!  Your first kiss with Linux will be remembered either fondly, or regretfully.  You decide.

Until next time!

No comments: