10 things you should know about every Linux installation(ZT)

    技术2022-05-11  6

    10 things you should know about every Linux installation

    November 18, 2005 Update - Today:   This article is also available as a TechRepublic download.

    Takeaway: There are numerous common features with every Linux installation. This document lists 10 of the more important ones you should know about.

    By Jeffrey G. Thomas

    Linux is not Windows, and although there are some similarities, you must realize that there may be a few "new ways of doing things" to learn before you can be comfortable in Linux. Linux is an open-source clone of UNIX, a secure operating system (OS) that predates DOS and Windows and is designed for multiple users. The items in the following list generally apply to any UNIX-based *nix system, such as Linux and the various BSD's. For the purposes of this article, assume that it's all Linux.

    Here are the 10 things to know

    Editor's note: As part of a recent IT Soapboxblog post I asked Linux users and evangelists in the TechRepublic community to step up to the plate and take a crack at producing some informative articles and downloads on the Linux operating system. This document is just one of the submissions inspired by that challenge. Just click the Linux challenge tag to track other published submissions stemming from this grass roots project.

    1. File hierarchy

    Unlike some other OS's that have a file tree for each drive, the Linux file system is one big tree. At the top you have / (Root) and every folder, file, and drive branches off of this Root.

    For example, say that you have two hard drives (named a and b), one floppy drive, and one CD-ROM. Let's say that the first hard drive has two partitions (named a1 and a2). In Windows, it would look like this:

    + hard drive a, partition one (hda1): C Drive+ hda2: D Drive+ hdb1: E Drive+ floppy: A drive+ CD-ROM: F Drive

    In Linux, you have one file system, not the five listed in the Windows example. Each drive is mounted onto the tree and acts just like a folder. The drives could be placed like this:

    + hda1: / (our Root)+ hda2: /home+ hdb1: /home/user/music+ floppy: /mnt/floppy+ CD-ROM: /mnt/cdrom

    Our D Drive and E Drive are attached within our C Drive and there is no need to go to the top to switch drives; the switching happens seamlessly as we move from one folder to another. The same is true with our Floppy and CD-ROM: they are just attached under /mnt as part of the one file system. These drives, in reality, can be attached almost anywhere in a Linux system, depending on how the installation (or user) set up the /etc/fstab file, which tells the computer where things get attached and how to handle them. See Figure A.

    Figure A

    File structure

    2. Modular system

    Think about the guts of Windows XP, Win2k, Win98, Win95, and Apple OS X. Each has different components inside and a different graphical look. What if you wanted the Media Player in XP, the File Manager in 98, the stability of Win2k, and the look of OS X all in one unit? In Linux, each aspect of the system is independent, so you can mix and match parts to make your very own Frankenstein OS. You can choose from a variety of programs to run as your firewall, another to play media, yet another to run your File Manager.

    Unlike the "tower" OS's from Microsoft, where everything is interconnected and depends on each aspect of the system, the Linux OS is spread out like a Market: everything works together for the common good, but vendors (independent parts of the OS) can be excluded, and the OS will still function. Don't want a Media Player or File Manager? Take it out! Your OS will not fall like a broken tower.

    This modularity is the reason for so many distributions of Linux (commonly called distros); any person or company can mix and match the programs they find most useful and slap a name on that collection. RedHat, Xandros, SimplyMEPIS, and Suse are all examples of distros.

    Some of the larger distros have copycats that use their settings, but change the included programs. This is the Linux way, and the mix-and-match approach gives users more choice in the long run. DistroWatch.com currently lists over 350 distributions of Linux. Many on the list are specialized to serve a specific group of people, but all can be altered to run the same programs.

    Because programs are interchangeable, the Graphical User Interface (GUI) is no exception. GUI's give you the look and feel of a modern OS with the mouse, program icons, menus, etc. Any Linux system (well, one that is running on a real computer, not a phone) can run one of many different GUI's, just like it can run many web browsers or different email client programs.

    Want your system to look like Windows? Use FVWM with the XP theme. Want it to be fast? Try IceWM. Want it to be more "full featured"?; try GNOME or KDE. All of these GUI's have benefits and drawbacks, but they all present the user with an interface that can be manipulated with a mouse. Although this may result in every Linux screen looking different, all of the GUI's are still doing the same behind-the-scenes work for you; just use your eyes and often it is not hard at all.

    3. Hardware, software, and everything in between

    Linux has come a long way in the few short years of its existence. It is less than half the age of Microsoft Windows, and yet it is more powerful, more stable, less resource-hungry, and graphically equal (if not superior) to this costly, buggy OS from Redmond.

    One thing that Linux doesn't yet have going for it is vendor support. If you really like Intuit's QuickBooks, for example, you cannot natively run it in Linux. There are projects to make Windows programs run in Linux, such as CrossOver Office and Wine, but these work with varying success, depending on the Windows program. Until software companies decide to port their programs to Linux, you will not be able to run them natively.

    Not all is lost, however. Open Source software has upward of 15,000 of programs that run natively in Linux. Because these programs are (usually) free of charge, they vary in quality, but the majority of programs are wonderfully written and constantly improved. These programs can import and export non-native file types as well. GNUCash can read those Quickbooks files just fine, and OpenOffice.org can read MSWord *.doc files. If you dislike GNUCash, don't despair. There are other similar programs also available for free, and more and more software companies are releasing Linux versions of their software.

    These same issues apply to hardware. Just as you cannot expect just any piece of hardware off the shelf to work with an Apple computer, the same can be said for Linux machines. Most standard hardware works perfectly; hard drives, RAM, flash drives, motherboards, NIC's, and digital cameras usually have little trouble under Linux. Newer, cutting edge hardware is a different story. Until hardware vendors choose to support Linux, the drivers needed to work these pieces of hardware must be written by the Linux community for free and in the community members' spare time.

    Therefore, there is a lag behind Windows support since hardware companies often work directly with Microsoft to ensure compatibility, and tend to let Linux volunteers figure out the Linux hardware support on their own. Laptops are notorious for their non-standard hardware; it can be a challenge to map special keys in Linux. The good news here is that vendor support for Linux hardware, like software, is changing for the better as more and more companies see their future in Linux.

    Everything in between the hardware and the software in a Linux machine is the kernel. This kernel is what connects the hardware to the software, and an updated kernel is made available via Internet every few weeks; the most current is 2.6.14. If you have hardware that isn't currently supported, there is a chance that a newer kernel could help you out. Installing this kernel yourself isn't always easy, however; that's where Package Managers come into play.

    4. Package Managers - Program installation made easy(er)

    There are many ways to install programs in Linux, but the easiest is with your distribution's Package Manager (PM). The PM makes sure that any missing files (called dependencies) are also installed so the program runs correctly. Choosing a distribution often comes down to which type of PM you like, but any Linux software can be installed on different distributions if you can find the corresponding Package.

    These PM's usually have an on-line repository for their programs. Installing an application is as easy as searching through the program repository and clicking Install. Can't find IceWM or MPlayer in your Package Manager's list? There is always a way to add a new on-line repository that will have what you are looking for. Some examples of Package Managers include Synaptic (based on dpkg and Apt) for Debian (and derivatives); Yum for RedHat (and derivatives); YaST2 for SuSE (and derivatives); and Emerge for Gentoo.

    5. Permissions

    Linux is designed to have multiple users, and these users fall into groups. Every user has permissions to read, write, or execute (R/W/X) their own files, and permission to change those permissions. Because Linux is designed for multiple users, each user has their own password and may restrict access to their files. These are called User Permissions.

    Each user belongs to one or more groups, and a user can set their file/folder permissions so that others in the group can read but not write the files, or any other combination of R/W/X. These are Group permissions. For example, Joe and Susan are both in Accounting. They can allow the Accounting group access to each other's files, but they can restrict that access from those in the Sales group.

    The Others permissions can allow or deny access to these files for anyone outside the Group. These permissions are for the safety of the overall system, as well as for each user's data. Most home users are fine to leave the default permissions alone on their files. (See Figure B)

    Figure B


    The Root user (not to be confused with the / Root of a file system), as the Administrator, has rights to all files and is the only user who can alter system-wide settings. The Root user has their own password, which is used for system maintenance. This distinction prevents a regular user from installing harmful spy ware on the system or deleting important files.

    6. Home directory

    Windows has My Documents, but where do you put files that aren't documents? Usually on the Windows Desktop! Linux can clutter the desktop too, but each of our users also has a Home directory, usually located at /home/user. Within that Home directory you often have Documents (/home/user/documents), program links, music (/home/user/Music), or whatever we want. We can create files and folders here, and organize or disorganize them as much as we want, just like it was our own personal Home. Depending on how our permissions are set, we can allow or prevent any other user access to these files (except the Root user).

    7. Default installation differences

    There are a few differences between Linux distributions, such as where some files are kept or what some of the default programs are named. Just knowing that the file system might be a bit different between RedHat and SuSE is a great start. Most users don't need to know what those differences are, but they should be aware that the internal file systems can be a bit different. When asking for help, make sure to let others know which distribution you are running. If you don't have troubles in your system or don't care to set up complex behind-the-scenes operations, don't worry too much about this.

    8. CLI, or "how to run"

    From the Start-type menu, the xterm program (also called Console) brings you to a Terminal, which looks a bit like a DOS window, but it actually predates and out-powers DOS. This is the Command Line Interface (CLI), the origin of our favorite OS which is present in every Linux distribution. We won't get into the finer details, which can fill books, but the CLI a powerful tool often needed to troubleshoot your computer. If you ask for help on the Internet and someone asks you to run lspci, they want you to start xterm, type lspci, hit enter, and then provide the screen's response.

    When you start an xterm, you are your regular user-self with limited powers. To get into Root User mode (see Permissions above) in an xterm, type su [enter], then type the Root password [enter]. Now you have a lot of power so be nice. The Root user can destroy anyone's data, including the system files needed to run Linux. To leave an xterm or su mode, type exit [enter].

    9. Ctrl-alt-escape

    Clicking the ctrl-alt-escape key combination changes your mouse into an X, skull-and-crossbones, or some other sinister mouse-cursor. In this mode, clicking on a misbehaving or frozen application will kill it. It is similar to the End Process in Windows Task Manager, but use with care. If you don't want to kill anything, use the Esc key to back out of kill mode. Clicking on the wrong program (including the desktop GUI) can cause a serious headache.

    10. The Internet is your friend!

    Many distros have a User's Forum where questions, answers, and tips are passed around. LinuxQuestions.org is a great site for overall Linux knowledge and help. Remember, before posting questions on any forum, research your questions (both at LQ and on Google) to avoid asking about an issue that may already be solved. Also, check the age of any solution that you find, as old answers may no longer apply to this fast-changing world of Open Source software. When asking a question, be sure to include as much (applicable) information as you can about your system, such as:

    The processor type (Intel or AMD or Apple PPC?) Your distribution (SuSE? Debian?) The program with which you're having trouble, and Any other relevant information.

    Keep an open mind

    Linux and open-source software have made leaps and bounds in the last few years, but for users coming from the closed world of Windows, the internal workings of Linux may seem foreign. An open mind and a willingness to share knowledge helps the Linux community grow, and we welcome you to our ranks.

    <!-- { .section { font-family:Verdana; font-size:11px; padding-top:7px; padding-bottom:10px; } } -->

    White Papers

    IT Security Solutions for Government Why Linux Is Good For ISVs RadioShack Saves Millions by Choosing Windows over Linux Why a Leading Theater Chain Chose Windows XP Embedded over Linux HP Scalable Visualization Array: Using Industry Standard Technology and Open Source Software to Add Visualization Capability to Clusters of Linux Systems