So you need to learn Linux and you need to learn it fast! What's a girl to do? Read on, MacDuff!
In this Daily Drill Down, I'm going to run through what will hopefully be the fastest way for you to learn the basic ins and outs of Linux. This tutorial will teach you:
- What to do when you first start up your new Linux machine
- How to run simple commands
- How to connect to the Internet
- How to install via .rpm files
- How to move around the desktop
- How to do a bit of customizing
This tutorial makes a few assumptions, including:
- You have Linux already installed on your computer
- The computer is going to be used as a desktop machine
- Your system will immediately boot to the graphical login (runlevel 5 in /etc/inittab)
- You're using the Red Hat 6.1 Linux distribution
- You're using the default desktop installed with Red Hat 6.1 (GNOME and Enlightenment)
- You have all of the necessary information to connect to your ISP
With that in mind, let's begin the beguine.
The startup and login
The first step in your Linux experience is booting. When you start your machine, you will be greeted with the LILO: prompt, which includes options that enable you to perform several tasks. The first option is the default, which prompts you to either press [Enter] or wait until the time expires to boot Linux. The second option is to press the [Tab] key, which displays a listing of all the operating systems that LILO (Linux boot manager) has detected. The names that tab displays are the commands to boot that particular OS—typically, you'll see either linux or dos (linux to boot Linux and dos to boot Windows). If you feel safer making an explicit choice, you can type either linux or dos to boot the respective OS.
The next step in your first Linux experience is logging on. The multiuser environment created by Linux makes this step necessary. Linux gives you the ability to create multiple accounts on one machine. How would the multiuser environment benefit the home desktop computer? Very simple: Since you have multiple users for that machine, you create more than one account so the children cannot peek into those unmentionables or send your bank statements to /dev/null. Sorry, I'm getting way ahead of myself.
The Red Hat graphical login tool is a very simple application to use. When the machine finishes booting, you'll see a blue login screen that asks for your login name. (Remember during installation you had to provide a user name and a password? This is one of the many places you'll use that information.) The Red Hat graphical login tool can do much more than a standard login, but for this tutorial, we'll stick to the basics.
You're booted up and logged on. Now what?
Once you provide your user name, you'll press [Enter] and supply your password. Next, you'll enter the GNOME/Enlightenment environment, where what you encounter will look very similar to the accustomed Windows environment—with a few extras.
When the default Red Hat Linux desktop boots, there are a few tools (other than the desktop tools) with which you'll be greeted. The first tool (the window on top of all others) is GMC or GNOME Midnight Commander. GMC is simply a front end (an application that offers a GUI interface for a previously existing program) for the long-in-the-tooth Midnight Commander. Midnight Commander is one of Linux's older file management systems, but is far from user friendly. GMC changes the user unfriendliness of MC by giving it a major GUI facelift and much more usability.
The second tool (window) that opens is the GNOME Help Browser. You'll find it beneficial to spend a little time browsing around this tool. Within the GNOME Help Browser, you'll find all of the FAQs and user guides for GNOME, as well as the Red Hat manuals and reference guides. By clicking the little X on the upper right corner of the window, you can close these tools. Why do I offer this very "common sense" piece of information? Although it's safe to assume within this particular DE anything that resembles a Windows-like behavior will mimic Windows-like behavior, there's another bit of "window" functionality that you will want to know (and will probably grow to love). If you double-click the title bar of any given window, that window will do what's called "shading" (borrowed from the Mac-world). By shading a window, you draw the entire window up into the title bar, so that only the title bar remains. Shading is an amazing way to save desktop real estate and a great way to impress your friends!
Once you've killed GMC and the GNOME Help Browser, it's time to get to work. The first thing most users want to do is connect to their ISP. Let's hold off on that step until we know our way around the desktop.
The two main features of the desktop are the GNOME Panel (akin to the Windows task bar) and the desktop icons. The GNOME Panel is a horizontal bar (which can be made vertical, edge, or corner—by default, it's edge) that contains a small arrow pointing to the left, a main menu (the button with the funny foot logo), some clickable buttons (GNOME Help Browser, Control Center, GNOME Terminal, and Netscape), a new-to-the-Linux-newbie tool called the Pager, a clock applet (small application), and a small arrow pointing to the right.
The first entries are the little arrows pointing either to the left or right. These arrows hide the panel. There are many times you will need extra real estate, and getting the panel out of your way is a very simple means of gaining the space. In order to hide the panel, click one of the arrows and the panel will slide out of your way (keeping the opposite arrow in view so you can restore the panel).
The next entry is the Main menu (with the GNOME foot logo), which is akin to the Windows Start button and contains all of the main tools/applications/menus that you'll use. The main menu is broken into submenus, which are broken into further submenus. This is very much like Windows, so by merely poking around a bit you will come to understand its layout and philosophy.
The next entry in the GNOME Panel is the GNOME Help Browser button. Hopefully you've already taken the time to explore this little ditty. If not, go ahead—I'll wait for you. To open the GHB, click the big button in the panel that has a "?" in the cartoon balloon (those Linux developers—what a sense of humor they have). To the right of the GHB is the heart of configuring the GNOME desktop environment: the Control Center. (Assuming you're using the out-of-the-box September GNOME that comes with Red Hat 6.1. The later versions, October and Helix, offer more functionality.) This application enables you to control all of the desktop configurations, including: background, screensaver, theme selector, window manager, keyboard bell, sound, CD properties, keyboard, mouse, startup programs, URL handlers, applications, and dialogs. You'll want to play around a bit within this application; but stick to the simpler aspects, such as background, screensaver, and theme selector. Like most other GNOME applications, the ControlCenter is all "point and click" and very intuitive, so you won't have any problems finding your way around. The theme selector is of special interest as it allows you to select some very elegant themes (or looks) for your GNOME environment. From within the Control Center, choose the Theme Selector and preview any of the given stock themes (of special note is the Jed3 theme ... very nicely done).
The button to the immediate right of the Control Center is the GNOME Terminal button. GNOME Terminal is the terminal emulator that runs stock on GNOME. A terminal emulator is where you'll run all your commands. Think of a terminal emulator as a DOS window that actually interacts with your working environment ... no really! Click the GNOME Terminal button and you'll see a window appear on your desktop. This new window will contain the standard border and title bar, but will also contain a menu bar. The menu bar contains the File, Edit, Settings, and Help menus and a scrollbar. The GNOME Terminal menu bar can be removed through the File menu, but it's better to leave it running. The menu bar enables you to perform, with a single mouse click, many operations that would normally require a few keyboard combinations. A new feature in the Settings menu enables you to customize the look of the GNOME Terminal.
When you close the terminal and start a new one, you'll notice that your customizations have been saved. When you open the GNOME Terminal, you'll see your bash prompt, which looks like:
This is similar to the Windows C:\WINDOWS> prompt you use in a Windows DOS window. One small quirk you may find annoying is that the default "feel" setting for the GNOME Terminal is basically "click to focus." When the GNOME Terminal first opens and you try to type something in its window, you will notice that nothing happens. In order to actually type into the window, you must give it focus by clicking within the window or on the title bar. We'll discuss a simple way of changing this later on.
Now we'll run a very simple command within the GNOME Terminal. The ls command will list the contents of the user's home directory and is part of the basic set of commands you will eventually want to learn. In order to run the ls command, type ls at the bash prompt and examine the output of the command. By typing ls, you're running the equivalent of a global Windows .exe or .bat file for a specific application (ls is actually an application with the command ls). You won't see anything in the output because you're in a directory that hasn't had anything added to it. Now we'll add an argument that will show all hidden files (in Linux a hidden file begins with a [.]). At your bash prompt, type ls -a and you'll be returned with something similar to:
The next button really needs very little explanation. Ladies and Gentlemen ... Netscape Communicator. This button starts the standard Netscape session with only one variation. When Linux Netscape is started for the first time, you'll receive approximately three warnings due to directories that do not exist. Simply click OK to all errors, the directories will be created, and you'll never see those errors again!
Linux Netscape contains one other little quirk that's necessary to point out. When Netscape crashes (and like all good browsers, it will) the application does not clean up a lock file in the ~/.netscape directory. Therefore, you have to manually remove this file. In order to manually remove the ~/.netscape/lock file, open a GNOME Terminal and at the [user@MACHINE_NAME user]$ prompt, type rm ~/.netscape/lock. Your system should then ask whether you want to remove that file and you should reply with a resounding "Y"!
The next step you must understand about configuring Netscape for use with Linux is that the pop and smtp servers cannot be configured until you're online. This is an odd quirk, but until your connection is up, you'll receive the message "Unknown Host" when you attempt to enter an smtp server. Hold off on the configuration of Netscape until you have your dial-up connection configured (see below).
The next section of the GNOME Panel is probably the most foreign to Windows users. The GNOME Pager is a tool that allows you to easily take advantage of the multiple desktop environment that Linux is famous for. The multiple desktop philosophy trips up most new users because it treats your computer as if there are, in the case of stock Red Hat 6.1, four desktops that are exact in size and configuration, but different in location.
Let me show you what I mean. First, open a GNOME Terminal, move your cursor down to the Desktop Pager Applet (the "four rectangles within a rectangle" next to the Netscape button) and click the upper right rectangle. Your GNOME Terminal should be gone. Now that the GNOME Terminal is gone, take a look at the Desktop Pager Applet. In the upper left rectangle, you'll see a small rectangle that represents the GNOME Terminal and you'll notice that your current desktop is blank. Now go back to the Desktop Pager Applet and click the upper left rectangle. You'll return to your original desktop and your GNOME Terminal.
You've just learned the basics of the Linux multiple desktop. What is this good for? One popular term within the Linux community is "screen real estate." Because of Linux's strong ability to handle many tasks and dedicate memory better than many other OSs, it can handle running a good deal of applications at once (without taking the resource hit that most other OSs take). Since Linux allows you to run more apps at once, you'll have the ability to keep your desktop as uncluttered as possible.
The final aspect of the GNOME Panel is the clock. Straight up ... it's a clock. 'Nuff said.
The desktop: Icons, configuration, and friends
The GNOME/Enlightenment desktop environment will be very friendly territory to the newly converted. On this desktop, you will find the very familiar clickable icons and menu-driven options.
First, let's examine the clickable icon. Most people's lives are run by the icon and it has become increasingly important, in the Linux community, to make sure the Linux desktop brings you all of the necessary elements of computing. On the stock Red Hat 6.1 GNOME/Enlightenment desktop, you will see the following icons (from top to bottom) on the left side of your screen:
- Home Directory
- Red Hat Support
- Red Hat Errata
- Linux Documents
- GNOME Web Site
- Floppy 0
The first icon, Home Directory, opens the GMC application in the ~/.gnome-desktop directory. This application can be browsed in a similar fashion as Explorer in Windows. The second icon, www.redhat.com, is a URL handler for the Red Hat Linux home page. When the www.redhat.com icon is clicked, Netscape Navigator will open to www.redhat.com. The second icon, Red Hat Support, opens Netscape to Red Hat's support center. The third icon opens to the Red Hat Errata page. The Errata page is a very important page—it enables you to download all package updates, bug fixes, and security updates for the Red Hat distribution. The next icon, Linux Documents, is home to the Linux Documentation Project, and the GNOME Web Site icon takes you to the GNOME Web site. The final icon, Floppy 0, allows you to mount the floppy device with a double click. When the floppy is mounted, the GMC application will open with the contents of the floppy displayed.
Creating new icons for application launching or for URL handling is very easy. First, right-click the desktop to reveal the GNOME desktop menu. The first entry in this menu is a submenu called New, which contains two entries: URL Link and Launcher. If you want to create an icon for a URL (which we do), select URL Link. Provide the URL (for example, www.techrepublic.com/tpg/) and click OK. Under the floppy icon, you'll see a new icon for the URL. Double-click the new icon and Netscape will open and browse to TechRepublic's TPG site (for our example). You can customize many aspects of this icon and change its caption by right-clicking it and selecting Properties.
Now we'll move on to creating a new launcher that will open everyone's favorite application: xmms (in the Windows-world it's called Winamp). Right-click the desktop, choose New, and then choose Launcher. First we need to fill out the required information for the following text areas:
These fields are fairly self-explanatory, with the possible exception of Command. The Name field is the name of the application to be launched, the Comment field is the comment that will be viewed under the icon, and the Command field is the command used to call the application. Input xmms into the Name, Comment, and Command text fields and then click the large square next to the "Icon:" label. You will be greeted with a window displaying all available icons. Click xmms_logo.xpm, then click OK twice. You'll see the finished icon in the lower left corner of the screen. Double-click it and the xmms application will appear. Instant icon!
The last desktop area to consider is the Enlightenment menu, which can only be found by clicking both the right and left mouse buttons simultaneously. When the Enlightenment menu appears, you will see the following submenus:
- GNOME Apps
- Other Programs
- Enlightenment Configuration
- About Enlightenment
- Restart Enlightenment
The GNOME Apps submenu contains all of the same menu entries found in the GNOME Panel main menu. The Other Programs submenu contains various terminal emulators, configuration and help tools, amusements, Netscape, and Gimp. The Desktop menu consists of four entries: Cleanup Desktop, Goto Next Desktop, Goto Previous Desktop, and FX-Ripples. The Themes submenu consists of a small menu of themes for the Enlightenment Window manager. Give some of these themes a try, or go to e.themes.org to learn how to install more Enlightenment themes for your desktop. The Enlightenment and Configuration submenu is what we're looking for. Remember earlier I mentioned the annoying quirk that you might find with this Window manager? In the Enlightenment Configuration menu, we can solve that little annoyance. Within this new window (for the Enlightenment Configuration) you'll see a section called Keyboard Focus Follows with three entries: Mouse Pointer, Sloppy Pointer, and Pointer Clicks. The default setting is Pointer Clicks, which dictates that, in order to work within a window, you must first click inside that window. This can be bothersome, so I like to use Sloppy Pointer—wherever the pointer was last will have focus. The other extreme is Mouse Pointer—wherever the pointer is will have focus. Select Sloppy Pointer and then click Apply. Before clicking OK, you may want to examine the other options. Some of these options can weigh a bit on the resources, but they're fun to play with.
Well, you've run a command or two, you've opened applications, you've configured your desktop, and now you're itching to get connected to your ISP! Roo Hoo! Let's get it goin'.
The dial-up connection tool used in Red Hat 6.1 is called rp3 and is a front end for various scripts (including the /etc/wvdial.conf script). Before we get into the uses of rp3, it's imperative that you download two updates. The first update is for the rp3 package itself. Now we're going to get our first taste of installing/upgrading using the RPM format. The rp3 update fixes a couple of major bugs and will be your first step to getting online. Before you download the rp3 update, open a GNOME Terminal and, at your bash prompt, type mkdir rpms, which will create a directory, called rpms, for you to download your updates into. Now, get the rp3 update and save it into the newly created directory. Once the file is in the new directory, cd into that directory with the command cd rpms and then su into root (type su and then, when prompted, type root's password) so you can run the following command:
rpm -Uvh rp3-1.0.1-1.i386.rpm
This command upgrades your current rp3 application. Once the upgrade is finished, you can remove the update rpm file by typing rm rp3-1.0.1-1.i386.rpm. The next upgrade is for the ppp package and will solve a number of issues. Download the ppp update and dump it into the same directory as the rp3 package. Now that the patch is in the ~/rpms directory, run the following command:
rpm -Uvh ppp-2.3.11-7.i386.rpm
Finally, remove the ppp update by typing rm ppp-2.3.10-3.i386.rpm.
Now that both packages are updated, it's time to run the configuration wizard. The rp3-config tool is called from the Internet submenu found under the GNOME Panel main menu. Select the Dialup Configuration Tool and you'll be prompted for root's password. Supply this password and the Internet Connection Wizard will launch. The wizard asks for the following information:
- Account name
- Phone number (including prefix if you need to "dial 9 to get out")
- Type of service (currently, it will either be "Normal ISP" or AT&T Global Network Service)
Once you've provided this information, you will be sent to the main screen where you can run the debug tool to check your connection. Typically, only one problem will occur with the rp3 tool (once the updates are current). The wvdial.conf file uses one setting called Stupid Mode that doesn't attempt to interpret any prompts from the terminal server. It starts pppd immediately after the modem connects. Apparently, there are ISPs that actually give you a login prompt, but work only if you start PPP, rather than logging in. Go figure. Stupid Mode is (naturally) disabled by default from the wvdial man page. Strangely, the default setting often does not work. If your modem dials and the handshake does not complete, your Stupid Mode setting is probably incorrect. In order to change this setting, you must edit the /etc/wvdial.conf script (done as root, of course). The section of script you are looking for will look similar to this:
Username = USERNAME
Password = PASSWORD
Modem = /dev/ttyS1
Phone = PHONE_NUMBER
Baud = 115200
Stupid mode = 0
Remote Name = *
Inherits = Dialer Defaults
Change the Stupid Mode setting to 0, save the file, and then attempt to connect again with the rp3-config debug tool (again, this tool is started from the Dialup Configuration Tool in the Internet submenu). Once the connection is configured, you can start your connection through the RH PPP Dialer, which is found in the same submenu as the Dialup Configuration Tool. And finally, an even simpler trick is to add the RH PPP Dialer applet to the GNOME Panel. To do so, navigate to the Panel | Applet | Network submenus. From the Network submenu, select the RH PPP Dialer and an account manager will appear. Select your connection and then click Yes to indicate that you want to start the interface. Once it's connected, a small, two-paned box will appear in your GNOME Panel. This box shows the connection and the speed at which you are transferring data. In order to disconnect from this device, click the applet and when prompted whether you want to Stop The Interface, select Yes.
Hopefully, your first crash course in Linux was a successful one. I've guided you through the most common and popular tasks with the intent to give you just enough knowledge to make you dangerous.
In the very near future, I will expand on this crash course and bring you more advanced strategies and techniques that will aid you in your quest for real computing. If you have any questions, remember that there's a multitude of arenas you can use to seek help ... including TechProGuild's own Guild Meetings, Forums, and Daily Drill Downs.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.