This action might not be possible to undo. Are you sure you want to continue?
We have developed this course for one basic reason: To bring the newcomer to Linux to the point where you can, using Linux, do everything that you do with MS Windows and much more. Due to the fact that Microsoft, enjoying an illegal monopoly , has its operating system installed on 90% of the world's computers, this course is mainly aimed at people who want to migrate to Linux from Microsoft products. The simple fact that you are getting this course off the Internet presupposes that you know how to use a PC. The course should be oriented towards people migrating from other OSes and in particular, MS Windows 9x, ME, 2000 and XP.
Our objectives are:
1. To explain the differences between working with Linux and working with other popular OSes. 2. To stress that the somewhat steeper learning curve in Linux will pay back in the amount of stability and flexibility. 3. To show that using Linux opens up a whole new world of computing. This means that a Linux user is not just a passive subject reacting to what the OS allows him/her to do but he/she is an active "developer" with complete control over the operating system.
Preparation What is Linux?
Linux is an operating system that evolved from a kernel created by Linus Torvalds when he was a student at the University of Helsinki. Generally, it is obvious to most people what Linux is. However, both for political and practical reasons, it needs to be explained further. To say that Linux is an operating system means that it's meant to be used as an alternative to other operating systems like MS-DOS, the various versions of MS Windows, Mac OS, Solaris and others. Linux is not a program like a word processor and is not a set of programs like an office suite.
A brief history of Linux
When Linus Torvalds was studying at the University of Helsinki, he was using a version of the UNIX operating system called 'Minix'. Linus and other users sent requests for modifications and improvements to Minix's creator, Andrew Tanenbaum, but he felt that they weren't necessary. That's when Linus decided to create his own operating system that would take into account users' comments and suggestions for improvements.
Free Software pre-Linux
This philosophy of asking for users' comments and suggestions and using them to improve computer programs was not new. Richard Stallman, who worked at the Massachusetts Institute of Technology, had been advocating just such an approach to computer programming and use since the early 1970's. He was a pioneer in the concept of 'free software', always pointing out that 'free' means 'freedom', not zero cost. Finding it difficult to continue working under conditions that he felt went against his concept of 'free software' he left MIT in 1984 and founded GNU. The goal of GNU was to produce software that was free to use, distribute and modify. Linus Torvalds'
goal 6 years later was basically the same: to produce an operating system that took into account user feedback.
We should point out here that the focal point of any operating system is its 'kernel'. Without going into great detail, the kernel is what tells the big chip that controls your computer to do what you want the program that you're using to do. To use a metaphor, if you go to your favorite Italian restaurant and order 'Spaghetti alla Bolognese', this dish is like your operating system. There are a lot of things that go into making that dish like pasta, tomato sauce, meatballs and cheese. Well, the kernel is like the pasta. Without pasta, that dish doesn't exist. You might as well find some bread and make a sandwich. A plate of just pasta is fairly unappetizing. Without a kernel, an operating system doesn't exist. Without programs, a kernel is useless.
1991, a fateful year
In 1991, ideal conditions existed that would create Linux. In essence, Linus Torvalds had a kernel but no programs of his own, Richard Stallman and GNU had programs but no working kernel. Read the two men's own words about this: Linus: "Sadly, a kernel by itself gets you nowhere. To get a working system you need a shell, compilers, a library etc." RMS: The GNU Hurd is not ready for production use. Fortunately, another kernel is available. [It is called] Linux. So combining the necessary programs provided by GNU in Cambridge, Massachusetts and a kernel, developed by Linus Torvalds in Helsinki, Finland, Linux was born. Due to the physical distances involved, the means used to get Linus' kernel together with the GNU programs was the Internet, then in its infancy. We can say then that Linux is an operating system that came to life on the Internet. The Internet would also be crucial in Linux's subsequent development as the means of coordinating the work of all the developers that have made Linux into what it is today.
Linux is introduced
Late in 1991, Linus Torvalds had his kernel and a few GNU programs wrapped around it so it would work well enough to show other people what he had done. And that's what he did. The first people to see Linux knew that Linus was on to something. At this point, though, he needed more people to help him. Here's what Linus had to say back in 1991. "Are you without a nice project and dying to cut your teeth on an OS you can try to modify for your needs?... This post might just be for you." People all over the world decided to take him up on it. At first, only people with extensive computer programming knowledge would be able to do anything with that early public version of Linux. These people started to offer their help. The version numbers of Linux were getting higher and higher. People began writing programs specifically to be run under Linux. Developers began writing drivers so different video cards, sound cards and other gadgets inside and outside your computer could use Linux. Nevertheless, throughout most of first part of the 1990's Linux did not get out of the 'GURU' stage. GURU is a term that has evolved to mean anyone who has special expertise in a particular subject. That is, you had to have special expertise in how computers worked to be able to install Linux in those days.
Linux, at first, not for everybody
Other popular software companies sold you a CD or a set of floppies and a brief instruction booklet and in probably less than a half an hour, you could install a fully working operating system on your PC. The only ability you needed was knowing how to read. Those companies had that intention when they actually sat down and developed their operating systems. Linus Torvalds didn't have that in mind when he developed Linux. It was just a hobby for him. Later on, companies like Red Hat made it their goal to bring Linux to the point where it could be installed just like any other operating system; by anyone who can follow a set of simple instructions, and they have succeeded. For some reason, though, Linux hasn't completely lost its 'Gurus only' image. This is largely because of the popular tech press' inability to explain in a meaningful way what Linux is. The truth is that few tech reporters have real life experience with Linux and it is reflected in their writing.
Today, Linux is enjoying a favorable press for the most part. This comes from the fact that Linux has proven to be a tremendously stable and versatile operating system, particularly as a network server. When Linux is deployed as a web server or in corporate networks, its down-time is almost negligible. There have been cases when Linux servers have been running for more than a year without re-booting and then only taken down for a brief period for routine maintenance. Its cost effectiveness has sold it more than anything else. Linux can be installed on a home PC as well as a network server for a fraction of the cost of other companies' software packages. More reliability and less cost - it's ideal. If you're reading this, you're obviously here to learn how to use Linux. Any learning experience means opening up to new ideas and new ways of doing things. As mentioned before, Linux is in the UNIX family of operating systems. UNIX is primarily designed to be used by professionals. You will have to learn some UNIX concepts in this lesson, but that doesn't mean that Linux is a professionals-only operating system. In fact, most major versions of Linux are designed to be as userfriendly and as easy to install as any other operating system on the market today. Now that you know what Linux is and how good it is, there's one more thing we have to do - install Linux!
Some preliminary considerations.
There are many different versions of Linux. Unlike other commercial operating systems that are controlled by one company, Linux is free to distribute and use. So, in the Linux world, there is a situation unlike what occurs in the proprietary operating system world: a number of companies, organizations and individuals have developed their own "versions" of the Linux operating system , known as distributions. There are versions of Linux that were developed to be installed on computers that receive heavy traffic, so to speak, like webpage servers. Some were developed to be used in networks where security is a priority; where sensitive information should only be accessed by a privileged few. There are versions of Linux that are meant to be installed on top of an existing operating system like Windows so people can try out Linux under familiar conditions. There are versions of Linux that are designed to be installed on platforms like Macintosh. There are versions of Linux with funny names like "Chainsaw Linux" (no kidding) and "Tutti-Frutti Linux" (yes, it's a joke)
What Linux is right for me?
Though you probably won't need them. But in reality. go get those manuals. There are others as well. if I were going mountain climbing. Prepare your manuals As we mentioned before. the cold. Now. The PR department at Microsoft is coming up with fewer and fewer reasons not to use Linux. like Debian. But even commercial operating systems that are billed as being the most user-friendly in the world can't guarantee a 100% problem-free installation. If I were going about my daily routine. Linux has been fit into all those environments and more. We invite you to consult that list before deciding on installing any version of Linux.This is a very difficult question to answer.a very scaled down version .just to cover the essentials. The best thing to do before attempting to install Linux is to get the manuals that came with your PC out of the closet and dust them off. Most PC users probably just need the everyday version. If I were going to a formal dinner. wind. Linux is just as easily installed and supports just as wide a range of hardware as Microsoft Windows does. This kind of Linux has been widely available for some time now. nobody can guarantee a problem-free installation for any operating system. Then . Linux will actually install more easily on older PCs than on some newer ones. Red Hat and SuSE . Major distributions of Linux have taken into account most standard hardware such as video cards. but as we said before. Mandrake. There are computer world equivalents of mountain climbing and formal dinners as well as just sitting around the house. rain and other adverse climactic conditions. they may help to track down a problem or prevent a future one. Linux on PCs containing Intel-based CPUs It would be impossible to cover all of the different types of Linux so this lesson will only deal with standard versions of Linux that are meant to be installed on PCs with Intel-based CPUs. the major versions of Linux have perfected their products to such a degree that they are very easy to install. To use an analogy. they have a lot to lose if Linux ever gets popular with the masses. You may be luckier than you thought. You may have heard of some of the companies and organizations that have created distributions for this platform. I would need specific clothes to protect me from scrapes. We should say here that it is not our intention to endorse the products of the companies we have mentioned here nor do we want to slight those companies that we haven't mentioned. Well designed programs will take you through the process of installation step by step so that you will be able to get Linux up and running in a relatively short period of time without any headaches. Linux Online maintains a list of all kinds of distributions. There are even versions of Linux that offer documentation and install programs in languages other than English. I would wear "normal" clothes. For this reason they have done everything in their power to "warn" the public that Linux is something that you probably don't want and don't need. modems and sound cards. and we'll meet you in the next lesson! An actual install Most reputable PC resellers will hand you a stack of manuals when you buy your machine. But let's imagine that you got a hand-me-down PC from your big brother or sister or you picked up your PC at a garage sale or you got the PC from some other source that we really don't want to know about. Since Microsoft makes its living selling people "ordinary" operating systems. There is even the equivalent of a swimsuit in Linux . I would need a tuxedo.
Do you have another operating system installed? 2. Getting Started with Linux . 1. via email. The important thing is that you have the option to have both. These usually come with 90 days of tech support. Linux really should never be touted as a zero cost option.Lesson 1 Debian GNU/Linux . Internet browsers. at very little cost. databases. now it's time to install Linux. back to the install. cameras and then there are a lot of things that Linux has to offer on top of all that that other operating systems don't. you will have what is known as a "dual-boot" system. you may download ISO images of the Linux distribution you have chosen (and that lets you have them free of charge). email. But there are a couple of questions you need to ask yourself. 'What's the difference?' you may ask.again. with or without manuals. Personal PC users can pick up a nice operating system for home use for around 30-50 US dollars. though. You've got your version of Linux and you just can't wait to use it. but it has cost you money for the CDs and your time (the costliest thing of all). you can still get Linux. you can do with Linux. The truth is that there is nothing in this world that comes at zero cost. Now. Our pick for an example walk-through installation and setup with be Debian GNU/Linux. it depends on how old it is. spreadsheets. This is somewhat fictitious. Downloading Linux One of the most misunderstood concepts of Linux is that it is widely spoken of not so much as a "free" operating system but as a "freebie" operating system. That means that you have a PC that can use two different operating systems. You can also get Linux from PC magazines that will often provide CDs of the major Linux distributions and some basic installation instructions for just the cost of the magazine. photo touch-ups. in most cases. Microsoft won't give you the source code to their products so you can make improvements (and we all know how much they need them). That's TOO old! Do you want a 'Dual-boot' system? OK. and install Linux as well. I think that I should pause here and say that everything that you can do with your garden variety operating system. CD Players. Don't try to install Linux on one of those old PCs with a monochrome monitor where everything comes out a yucky green color. MP3. but better as an operating system that can be obtained and maintained at a very low cost. The "free" that most people think of is the free of "freebie" or "handout". If you happen to have a fast Internet connection and a CD burner. You can pick up a nice boxed set from the makers of commercial distributions. The "free" ideally refers to the source code of Linux. Do you want to continue to use it? If you want to keep an existing operating system. That means word processing.or at least for the programs that aren't proprietary. but the majority of Linux distributions come with the source code . If you don't happen to have a fast connection and a CD burner.
4. You may want to consider contacting a local distributor of Debian CDs. It can also be found running on thousands of mission critical servers that have to be up 24/7. He was one of the founders of Pixar. and Finding Nemo. The Debian project is sponsored by Software in the Public Interest. the company that created the Toy Story films. There are two major ways to do this. Getting Debian GNU/Linux If you have a broadband connection (cable. Debian gets its name from the combination of Ian Murdoch and his wife Debra's name (Deb-Ian) One of the Linux community's most illustrious people has been a primary developer of Debian. it cannot be described as difficult either. quality Linux distribution with a long history (in Linux terms) 2. A solid. we have chosen Debian GNU/Linux for an example install. so we go over installation using this method.As it would be impossible in this course to talk about and give installation instructions for all of the Linux distributions. Debian has no company behind it. Monsters Inc. Non-profit and non-commercial (which lets us off the hook on a lot of issues!) 3. It forms the base of many user-friendly distributions like Ubuntu. The most popular is to burn the Debian ISO images to CDs and install. Though the installation procedure is not as easy as some commercial distributions. Why have we chosen this distribution? It is: 1. The major advantage to Debian is that it can be updated easily via their much lauded aptget system. Linspire and Xandros. xDSL or better). the files are downloaded as the installer needs them. About Debian The Debian project was founded by Ian Murdock in 1993. downloading Debian would be an extremely frustrating experience.org/distrib/ If you don't happen to have a broadband connection. this is an ideal option. from newcomer to seasoned IT professional. Applicable to a wide range of uses and users.debian. More information on these methods can be found at http://www. Consult this page for further information about distributors in your area: http://www. I'm talking about Bruce Perens. you can easily obtain this distribution and install it. Preliminary considerations You may be wondering if you can keep another operation system (ie. If you have a CD burner. The second is to obtain a minimal ISO image especially designed for an install over the Internet. Despite its not-for-profit status. Easily obtained and updated.debian. MS Windows which other one is there?) on your computer. With this option. Debian is an extremely versatile distribution. . You can.org/CD/vendors/ Installation from CD This is probably going to be the most common way of installing Debian. This can also be done by downloading floppy disk image files instead of CD images. a non-profit organization dedicated to helping produce open-source software and hardware. We will go over this in more detail shortly.
you don't have to be "weaned" off that. You may decide you want to throw away Windows all together! Summing up. If you use the page up/ page down keys. so I always figure . There's really no need here to go into what your BIOS is or what it does. When you turn on your computer. my first install of Slackware Linux was on the D: partition of my Windows workstation.) make it such that a MS Windows user could have his/her workstation switched with a Linux machine overnight and they would barely break a sweat getting used to it. Pressing DEL when your computer boots up will just get you into the BIOS setup tools. etc. being those who run the financial software 'Quicken'). You'll see a blue screen pop up with some menu items.what's the use in re-sizing when you can start clean from scratch. so I find these stories about being "weaned" off Windows to be ridiculous (the exception. That's the one you want. You can either erase the drive and repartition a blank drive or you can attempt to repartition a working hard drive. so advice on doing it would be of dubious quality. browsers . even in a "second fiddle" role.x products. If you've bought a new car. if your PC is less than 5 years old. Getting Started with Linux . What we can say about dual-booting If you happen to have MS Windows 9. Anything that mentions the word DEL usually scares people. there are some supposedly nondestructive re-sizing tools. I recommend Linux-only installations. Linux has become quite "mature" as an end-user operating system. you can start a Linux installation right from the CD-ROM drive. What you need to select is the item 'BIOS FEATURES SETUP' You'll see some more menu items. It shouldn't. Why? There are a couple of reasons: • • • Lack of experience with the newer Microsoft products. As a matter of fact. you can set this item . There's very little you can do with Microsoft products that Linux won't let you do as well. supposedly. This is relatively easy to deal with. there's a little message that says 'Press DEL to enter setup'. You just trade in the old one and start driving the new one. He hasn't done it with any of the more recent ones. They always tell you to back up your data before proceeding. unless of course you start pressing buttons randomly. The author must admit that he's installed a great number of Linux distributions side by side with Windows 9. The way to find out is to look at your computer's BIOS. It won't get you into trouble. Let's just say that it's there and you need it for your computer to work.Are we going to explain how to do it? Not in great detail. There's one that says 'Boot sequence'. what was done in the "old" days was to install Windows in C: and D: partitions. If you've got one partition with Windows on it. The graphic user interfaces available plus the ever-growing numbers of productivity applications (office suites.x you must repartition your hard drive to make room for Linux.Lesson 2 Installation of Debian GNU/Linux Booting from a CD Chances are. email applications. Enough said there. We don't work for Microsoft We advocate alternatives to Microsoft products and not the continued use of them. Ideally. Everything works very much in the same way.
That just means that it will look for the disk in your CDROM drive first when the computer boots. You can make a boot floppy. We'll remind you later. We'll get to that in a minute. Press ESC and then choose the item 'SAVE AND EXIT SETUP'. having the programs that will let you do anything you did with your Windows system. As we mentioned before. You can divide it into sections.C . But installing Linux isn't dangerous and if you choose to install you may not need such a drastic solution to your partition problem. There's a version for Linux but it doesn't mention Will Robinson. You should know that any decent working Linux system and by decent. Then you will need another partition known as a 'swap' partition. like two people sharing the same apartment. unless you've got a hard drive that's bursting at the seams. you are free to install Linux in . the other operating system should be re-installed first. There's a tool called FIPS that comes with major Linux versions. or Ginger and Marianne or even the Professor and Marianne if you like. I'd plan for a bit more To talk about where Linux and other operating systems should go. Linux may call them /hda3 and /hda5 for example. That means installing it in /hda1 in Linux speak. after you've divided it. I mean. Don't forget to set it back to 'C' when you're finished installing Linux. I just use these bad jokes as a way of saying that C and D are naming conventions that belong to other operating systems. Will Robinson". They often come with boxed sets. You can call them Ginger and Fred. Unlike a pie. That may be an option for you. and that way it thinks it's the only one there. one person will always exert his rights over the other. And if you want those photos of Hawaii on there. Please keep that in mind. So remember.C. For example. but if you yours didn't come with one. If you can't boot from your CD there's an option to create a boot floppy. My dog did try to eat my hard disk once and he really relishes the floppies I leave lying around.so that it says CD-ROM first. If you have that important term paper on your hard disk. you'll need to make back-up copies of them.Lesson 2 Partitioning Your hard disk is like a pie. you might just see A. so even though it's really not going to be this way. If you're fortunate enough to have a hard drive with more than one partition (the old C: and D: routine).forever! [cue ominous organ music]. I digress. then it may be just a question of moving some files around. This will re-arrange your hard drive so you can install Linux.A and there's no CD-ROM mentioned there. The classic way of partitioning your hard disk is with a program called 'fdisk' The program comes with a lot of whistles and buzzers and flashing messages that say "Danger. Unfortunately this lesson can't take into account everybody's individual circumstances. we'll cover how to create one further along. if you've chosen to go the fdisk route. This 'swap' partition is just a way that Linux uses to get more memory so that you don't run out of it. Don't panic. Linux doesn't use them. In any situation where you've got two things sharing the same space. There are also other commercial products that will do the same. We want to say here that this is the SWAT team method of doing it . you have to install them in the first 'primary' partition. In your machine's BIOS.will take at least 2 gigabytes. you can't give a piece to the dog. When you've got that re-installed. but alas. popular operating systems would generally call them C and D. Getting Started with Linux . Other operating systems usually want to be the only ones in the computer. if you had two partitions.the scorched-earth policy of partitioning. The re-partioning using this method will get rid of them . or pictures of that dream vacation to Hawaii that you haven't shown to your Aunt Betty yet or your best DOOM scores.
This kind of a partition scheme may come in handy if you have problems with your hard disk. Then my partition scheme ends up looking like this: Partition swap / (boot) /usr /home Location /dev/hda2 /dev/hda1 /dev/hda3 /dev/hda4 Size 500 mb 1. What you'll have to do first is partition the hard drive. Restart the computer.what's left. . We'll talk more about that in another lesson. Now is the moment of truth. /usr will contain most of the programs that will run on your machine. this is the scheme that works for me: Let's take a 10 gigabyte hard drive as an example.Lesson 2 Sundry installation tasks At this point you should have your hard drive partitioned and these partitions assigned to what areas they'll be housing. This is simply a way that Linux uses to get an extra memory boost. This should now boot the Linux kernel located on your CD ROM. Before we actually assign the other partitions their places and functions. /home will contain your personal files. That will come after.2 gb 3. Custom dictates that your swap partition be double your ram memory. Now you should initialize the / partition . and we're ready to go. Don't go to the next step yet. Once you've installed Linux. It doesn't really take into account that you want to initialize /usr and /home partitions. Don't worry about the /usr and /home parts. There is an easy way to do this. Getting Started with Linux . you create what's known as a SWAP partition. We've got the CD in the drive. Getting Started with Linux .the one that will boot the Linux kernel. you can actually see the other system's partition.Lesson 2 Plunk that CD in the drive Okay. From this figure. You can dedicate the whole hard disk or non-Windows partition (depending on the type of install you're doing). First.5 gb 5 gb Assign partitions to look like this. Do this now. Now. you should see how much RAM you have. the feel free to make a 500 megabyte swap partition. You should go back and initialize these partitions now before proceeding. we need to initialize and activate a the swap partition. So if you've got 256 megabytes of RAM. You must indicate here that you want / to be the bootable partition. That is to partition your hard disk even further and put "parts" of Linux on separate partitions. there is what I consider a little glitch in the Debian install. You may be able to save information if it's located in different partitions easier than if it were only one big partition. sort of like those phony mirrors at the supermarket. For example. There is a better alternative.
If you're contemplating a dual-boot system. If you don't choose this. At this point. Once again. You should also choose the settings 'make system bootable'. Now. we're going to tell it to boot up the Linux operating system.Now. You should choose this if you think you'll be needing extra security. But at least make sure to remove the CD or else it will boot the CD again and start the install process again. you'll have to answer a few questions about configuration. You'll have to evaluate this on your own. The "MBR" is a little slice of the hard disk pie reserved for moments like this! The program will now ask you to create a rescue floppy. Getting Started with Linux . to better use your hardware. your safest bet is to install LILO in the 'master boot record' when the install program asks you. It essentially does nothing unless you tell it to do. It might be a good idea now. OK. you should choose a 'domain' name. Later. you can make them from scratch!) and my system has become unbootable. Debian does a pretty good job of auto-detecting what you have. After. Even if you're not running an Internet server and even if you don't have a network you should choose a name as if you had one. For example. You'll now be asked if you want to use Md5 passwords. You can always rely on a rescue floppy to get you out of this situation. Debian uses a program called 'LILO' to do this. as we're installing from a CD.Lesson 2 Reboot and basic configuration Your new Debian GNU/Linux system is now rebooting. I have often made the fatal mistake of *not* correctly configuring LILO when I have made a new Linux kernel (yes. Without getting into a lot of technical jargon. to go back into the BIOS and set it back for the machine to boot from your hard drive first (instead of from your CD drive). In the case of a single machine or a network that's connected to the outside only by way of a dial-up connection. People who know that they're going to have to use foreign character fonts may want to add additional support for font sets. of course. without going into any technical jargon. comes the point in the process to install the Linux kernel. you'll be asked if you want a 'shadow' password system.net etc on the end. now's the time to reboot the basic system that Debian has installed. Each block (the four numbered set separated by periods) should be separated by a space. you'll have to choose a 'hostname' or name for your computer. You need to remove the floppy and the CD from the drives. you should choose 'CD-Rom' for the installation procedure. You can choose additional parts to add to the kernel. Md5 passwords are protected with an extra layer of security. I would. . Normally if you were in fact a server providing Internet services.com. you can also tell it to ask you to choose from different operating systems at boot. you should choose a single name without the dot extension. so there shouldn't be any need to touch anything here. known as modules. Your hard disk is basically a piece of metal with a metal disk flying around in it at incredible speeds. Use whatever naming scheme is comfortable for you. These will come in handy. Right now. you would choose a name and append . At this point. you can actually make alternative versions of the Linux kernel and have LILO boot them. Now you should enter your ISP's domain name server IPs. this is another Unix scheme for extra security. as your machine reboots. be a name registered with an official domain name registry. You should always answer 'yes' to this one because . When that's finished.
without it, your password, especially if it's some dictionary word, would become very easy to crack. By the way, you should never use a dictionary word as a password. As we're on the subject of passwords, now it's time to enter the password for the famous 'root' account. 'root' is the administrator of the system. It's also known as the superuser account. We'll get into more detail on the duties and privileges of root later on. Suffice it to say, you should now type in a password for the 'root' account. Please choose one that's easy for you to remember but would be difficult to guess or "crack". For example, if I were a Star Trek fan, I might be tempted to use Spock as a password. Spock probably isn't in the dictionary, but it might be so well known now that it would be found in any program that crackers use to get into systems. Therefore, I would choose something a little less well-known in Trek lore and modify it somewhat. Trek fans will remember that mutant brat who once tried to take over the Enterprise, Charlie X. Well, 'ch4rl13X' might be a good password. Taking some letters and replacing them with similar looking numbers is an acceptable password procedure. The most secure method is, of course, creating a random string of lower case and capital letters and numbers and just remembering it. 'C2jl7y2B' is an excellent password. It is, however, difficult to remember. In the end, everybody comes up with his/own own scheme that works. Now you should create an account to work with normally. What I mean by "normally" is that Linux is a true multi-user system, so one machine can be used by hundreds of users. When each logs in, he/she is restricted to modifying only the files owned by him/her. This insures a lot of security and removes a lot of headaches. You should never do routine work as root. This account should be only used to perform important administrative tasks. Feel free to use your first name or the first letter of your name and your last name as the login for this account. Follow the password convention you're comfortable with. Now, you'll be asked to remove PCMCIA from the system if yours doesn't use it. Feel free to do so. You will now be asked if you want to configure your system to use your ISP. If you have a dial-up connection, this is a good time to use it. If you connect by way of broadband or better, you can skip this part. At this point, we're ready to choose the rest of the packages that will make up our Debian system.
Getting Started with Linux - Lesson 2 Completing the install process
Now it's time to begin inserting each one of the CDs you have. They will be scanned for available packages for install. There is a maximum of 8 in the set. Insert each one and wait until you are asked for another. When you have completed the scanning process, you will be asked to choose another 'apt' source. With Debian, you can download and update packages automatically right off this Internet with the 'apt' system. We will configure this later, right now it's best not to choose another apt source besides the CDs. At this point, if you are connected to the Internet by way of broadband for example and the install program can make a connection to Debian's security site, it will now start searching that site for security updates. From the time the ISO images are released to the point where you are installing, security flaws may have been found in
certain programs included with Debian. For this reason a check is made and any programs with flaws are marked and updated copies downloaded and installed. After the security updates are finished, you will be presented with the possibility of doing a simple install with The Debian Task Installer. This will install programs after you have indicated your general preferences from a menu. If you are more adventurous, you may choose the more advanced install process by way of dselect. Here you will choose packages "by hand" from a list of hundreds. Though the dselect interface is not visually appealing and may appear daunting to newcomers, it is fairly straight forward and is actually quite user friendly in the sense that it is almost impossible to run into trouble with the packages you want to install. If you were to choose a package that conflicted with something else, you are notified. That way, you can either choose to keep the package that Debian recommends or "unselect" the package so your own choice can be installed.
At the fork(s) in the road
Here we reach the end of the install section. You will have to do some more work in this department, but due to the fact that the packages each person might choose and the hardware in his/her machine, we can't really document accurately what's going to go on from here. Our install road has reached a plethora of forks in it. Some simple advice: just answer the questions as accurately as you can and you should be fine.
We'll assume that you've got a working Debian system now. If you've got a broadband or better connection to the Internet, you should now configure the apt-get system which will allow you to update your system quickly and painlessly. It will also allow you to get new programs by downloading and installing them automatically. If you have a basic knowledge of Unix commands already, You should go to the directory /etc/apt/ and do the following (as root). (Even if you don't, you may want to try it!) mv sources.list sources.list.old This renames the file sources.list to sources.list.old. sources.list is what told the 'dselect' and 'apt' programs where to get the packages to be installed. Now we're going to change things a bit. We'll tell them to get packages off the Internet directly. We need to create a new sources.list file and add our new package sources to it. Do this first: vi sources.list This brings up the text editor 'vi'. There are people who love this program so much, they will challenge you to a pistol duel at 20 paces if you tell them you think it's lousy. If you have zero experience with Linux or Unix, 'vi' is probably *not* the text editor for you at this point, but with a few simple strokes of the keyboard, we can do what we want for now. Hit the escape (ESC) key and the letter 'i' and your ready to insert the following.
deb http://http.us.debian.org/debian stable main contrib non-free deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb http://security.debian.org stable/updates main contrib non-free
You may want to go to Debian's homepage and look up suitable mirror sites nearer to you. I'm sure the people who maintain the Debian website would appreciate it too! Now, to save the file, hit ESC again and ':' the type 'wq' (meaning write-quit) and your file is saved. Now you're ready to keep your Debian system in shape. We'll give you a refresher later on in the course, but you will probably be making use of these commands while you use Debian. - will update your system with the latest security enhances packages. Use: apt-get upgrade --show-upgraded to get a little more verbose report of what's going on.
apt-get update apt-get --purge remove [program/package name]
removes any trace of a
program from your system.
apt-get install [program/package name]
- installs a new program.
Now, let's see what we can do with that Debian system!
Getting Started with Linux - Lesson 3 Working with Linux - First Things First
When you work as root
You have now installed Linux and the first thing you did was login as 'root'. Then you provided a password so that you and ONLY you could login to the system as 'root'. When you decide to work as root, you had better go into a phone booth first and change into a blue suit with a big 'S' on the front because 'root' is known as the 'superuser' (you can skip the red tights if you want). That's really not meant to be just a witty reference to the Man of Steel. Actually, it is much more glamorous to be 'Superman' but root is actually more like the 'janitor' of the Linux system. Root has the keys to everything. He can shut off the lights, shut off the heat, lock you out of the building; he has to clean up the system and in the end make sure everything runs. And the most important thing about being a janitor - he sees everything.
'root' is not for routine work
As I mentioned, Linux makes your computer a true multi-user system, which means that besides root, you can and should work as another person. I say 'should' because doing routine work as 'root' could be hazardous to your health. When I first started using Linux myself, information was not all that readily available and I still had that 'one computer- one user' concept in my brain. It was after I had trashed all of the files and programs that make Linux run that I realized that working regularly as root wasn't a good idea.
Getting Started with Linux - Lesson 3
Working as another user
. Now you should give yourself a password. Now 'root' has to do this stuff. You'll see this: /home. You may pick the name you like. To see what's in this new directory.one password'. then how do you do your day to day work with Linux? That's easy.typing: cd /home you can make sure you're in the /home directory by typing 'pwd'. SuSE. I know I just warned you about working as root. now it's time to create your account. If your name is Hrothgar. . Go to the /home directory. use 'Hrothgar' or 'Hrothie' instead of 'bob' for the remainder of the lesson. That doesn't matter. you have to do the following. you can also use the command 'useradd'. Try your name. Most major distributions have tools to do this. Getting Started with Linux . This way I can organize my work a lot better and backups are easier this way too. By the way. Also. isn't it? Try this: useradd bob.Well.Lesson 4 Creating your 'routine' in Linux What's in your user directory When you create a new user. if Prince Charles is reading this. one vote' it's 'one user . It should not be inferred here that I have split-personality disorder. I am just a guy with a couple of different jobs. has a nice tool called YAST which lets you add users painlessly. Actually you won't get your hands dirty unless you're eating barbecued ribs at the same time. Bob. Follow the same advice I gave previously about passwords. You will be asked to repeat it. there is a directory created for that user in /home. I can work as different people. Like 'one man. There is also the get-your-hands-dirty way of doing this. which Linux doesn't like .he should try 'charlie'. You do it by working as a user other than root. Using 'useradd' and 'passwd' To add a new user. You just fill in the correct information. You might not see anything. Charles Philip Arthur George is a bit too long and has spaces. Kind of a logical name. Adding a new user Well. One thing I find EXTREMELY helpful is that with Linux. don't use your 'root' password. Linux has been told that there's a new user and his name's 'bob'. Yes. for example. Do this: passwd bob Linux will ask you for your password. but this is where you have to exert your authority. Consult your Linux version for information on their tools. You probably won't see any fireworks go off. If your name is "Bob" then you could create a user account for 'bob'.
This lesson will cover those commands which you will need to see what's under Linux's hood. That is /root.' (period/dot). you'll see some files that begin with a '. The first one we should look at is 'cd'. It is a free version of the Bourne shell and uses a little play on words. You can type: ls -a to see what's in the directory. Those would normally be hidden from you if you didn't use the -a. Try this one: cd / This will get you into the 'root' or main directory. With the -a option. Again MS-DOS users will be familiar with this.Lesson 4 The basic directory structure in Linux Now type this: ls You will probably see something like this: cdrom dev bin boot home lib etc floppy opt tmp proc usr lost+found root var mnt sbin . though. bash means "Bourne Again Shell". but we didn't go into them much. Now you can go to work as 'bob'.Lesson 4 The Linux file system Now's the time to learn a little bit about the Linux file system. Any operating system uses a shell to get commands from the keyboard to the computer. There are actually programs for Linux where you talk through a microphone and Linux will carry out commands that you've programmed in advance. we'll concentrate on the keyboard. the king of kings. The most popular shell used for Linux is the bash shell.Now you need to type: cd bob. 'hrothgar' or whoever you happen to be. The Linux shell When you're running Linux and start to type things on that black screen. cd will get you in and out of directories. MS-DOS users will be familiar with that one. you are using a shell. We'll learn about where Linux puts it stuff. Getting Started with Linux . where to find stuff and a little bit about what that stuff is. your show of shows. It's the directory of directories. We'll go into more detail with the ls command later. as you can see. It's really cool. It's a lot easier than punching holes in cards like they used to do in the old days. Getting in and out of directories with 'cd' We saw a few commands in the last lesson. The root directory shouldn't be confused with root's directory. For now. Getting Started with Linux . We will handle a lot of commands in more detail in later lessons.
Pressing the down button gets you back to your most recent commands. First the long way.conf. lilo. You know. The /etc directory Now let's look at another directory.conf And you don't even have to type the whole thing.Lesson 4 Some more cool short cuts Try this one: type ls m push the tab key. This is a file that contains your startup message. You can even type the command history and all of the last 400 or so commands you've typed will be presented. Your commands are saved in a history file located in your home directory. Just stop on the command you want and press 'enter'.They will be blue in color. The /bin directory Now type this: cd bin Type ls again. bin/ is one of the most important directories in Linux.conf' or even part of it and press the tab key anymore. This houses most of the configuration files for Linux. For example. I like that one so I haven't changed it. Isn't that cool! Getting Started with Linux . Do you want to make sure that lilo. You should see 'motd'. depending on your version of Linux). when people say. SuSE has a famous one that says 'Have a lot of fun!'. I have always felt this one was misnamed.conf is still in there? You don't have to type 'lilo. Your last commands will appear when you do that. Anyway. As you get more proficient in . Linux will type the rest for you. There's a long way and a short cut. throw it in the bin'. The more times you press the up button. You will now see every file in the directory that begins with the letter 'm' Now add an 'o' on to ls m so you get ls mo . You'll find all of the most used commands there. you'll see: lilo. You could just type 'ls li' and push the tab key. This is the famous bin/ directory. but you keep pushing. Right now you should be seeing a lot of red (or green. you are now in the etc/ directory. Linux is going to beep a couple of times. 'cd etc' will get you into the etc/ directory. 'cd . You just have to press the up arrow.now push the tab key. the file that tells you which OS to boot is in there. Those are programs.' will get you out of bin/.. Actually. the farther back in time you go. or you can just type 'cd /etc' in the bin/ directory and it will bring you to the etc/ directory . but you can change it so that Linux says anything you want when you log in. Those are directories. 'That's no good.
but they're only meant to be used by root. you won't be able to do anything while you're there. For example. because you may need to use two or more different types of kernels in the future. You'll see mainly sub-directories here. You will eventually have to use this directory. However. 'Shutdown' is in there. like dates. 'You don't have to know that'. It will say 'root' a lot. Root's home directory is a restricted area for everybody else. so your hard disk is kept track of as a file that sits there. everything is a file Yes. come jumping out of your computer. Power users may change the location of the kernel for reasons of their own (they may prefer /shoe). The /boot directory Doing: cd /boot will get you into the /boot directory. The usr/ directory contains files and programs meant to be used by all of the users on the system. The /sbin directory /sbin is another one of those off-limits directories. Everything is considered a file in Linux.Lesson 4 In Linux. Linux response is sort of like. That will be taken up in a more advanced lesson. root's directory . not only is that digital photo of The Eiffel Tower a file but your monitor is a file too! How can that be? Let's try to explain it. you will be taken to the directory /root. No./root If you are not working as 'root' and you type cd /root. You may look. The /usr directory Let's talk about using some options with commands. This directory is like /bin in that it has frequently used programs in it. You will not find any boots or shoes or footwear of any kind there. Try this: First let's go to the usr/ directory by doing cd /usr then type: ls -l . You can often find out the answer to the question: How did I do that? by consulting your shell history. he or she would get a message . typing: ls -l will give you more detailed information about the contents of a directory. If a user other than root tried to shutdown the system.Linux. so don't worry about that. You will see more information. That's where the Linux kernel usually is. some numbers. Getting Started with Linux . but it is normally placed there on most systems. your hard drive will be known as /dev/hda. you'll find that this really comes in handy. If you're using an IDE hard drive (as opposed to SCSI). Users' home directories are under certain restrictions for other users as well. but you can't touch. You will probably not have to look in /dev very much. We'll get into more detail about what all of that means later in the course. you'll see a lot of yellow outlined in black. These are the devices that your system uses or can use. land on the floor and spill out ooze all over the place. because your hard disk will spin around. not really. Only root can shutdown the system. The /dev directory If you do cd /dev and then ls. Don't delete that. letter combinations.
Most programs. And if it didn't then I'd be in trouble. That database would obviously grow in size.' (period/dot). This is a directory for storing users' personal files. usually have a pre-configuration program that makes sure that they can find what libraries they "depend" on to run.Lesson 4 Home Sweet Home We talked about /home before.. variable size) For example. That's where the name /lib comes from. When you double click on an icon of a photo. The /lib directory /lib is for library files. If they don't. It is also the normal place where email servers store their incoming mail. Programs may use libraries to carry out their functions. It's mainly the programs that work under a windows manager that take advantage of this directory. The temporary file is deleted when you close the KDE image program. That will sometimes happen when you've downloaded a program and had to compile it yourself from source. What's left The /floppy /cdrom and /mnt directories Most installations of Linux will also provide these directories: . You will find later on that when you use a Windows-style system with Linux like KDE. email varies in size as well. The /tmp directory /tmp is a directory that is used to store temporary files. One is called MySQL. Even then. MySQL keeps its data in a subdirectory of /var called /var/mysql/. even when compiled from source. the photo comes up for you to see but a temporary file is created while you're looking at the photo. Different programs use the same libraries. You will probably not have to worry about this directory much unless you start getting messages like 'can't find shared library. I would have a database to register purchases. Then that person would be followed by the secret police for three months.e. These preferences are usually included in configuration files which are also stored in users' home directories. If I had an e-commerce website. getting what are known as "dependency" problems are quite rare. Getting Started with Linux . this window manager will create files there for temporary use.. so Linux will store them here so that every program knows where to find them.'. there are a few excellent databases for Linux. Again.saying that only root can do that. Normally. Most of these files start with a '. The /var directory /var is a directory for certain files that may change their size (i. 'cd /home/[username]' and type: ls -a you will see these files. All of us have certain preferences for using programs. they'll tell you that you can't install the program. If you go to your home directory. as the name may suggest.
Well. At first. And then when you're finished you'll have to shut off your computer. you're not going to be able to just click on an 'a:' icon or a 'd:' icon. Later on.it will run a check on your hard disk automatically when you use it again. If you have a big hard disk. Let's just say that in Linux. As I said. Imagine if your ISP shut off the computer every night! The Internet is a 24/7 business so that wouldn't be practical. you might as well go and make yourself a sandwich because it's going to take a while./mnt /cdrom /floppy These shouldn't contain anything. we've looked under Linux's hood. Actually. so we should maybe let our machine have a rest too once and a while. or if there's a power outage that shuts it off for you. we'll use the shutdown command The importance of the 'shutdown' command As anyone who's used a computer knows. so to speak. if you shut off Linux incorrectly or there was an inopportune thunder storm and you lost electrical power. if you shut off you're computer before you've finished saving work. and you've looked around at what you have. but you should always use the shutdown command when you want to shut off your computer. Linux will tell you about it if you don't .Lesson 5 Day to day with Linux Shutting down Linux At this point you should have installed Linux. That will very rarely happen these days. Getting Started with Linux . more about these directories later in the course. There are also people who probably just shut off their monitor. as opposed to some later time. As you probably get some sleep occasionally. there are computers that are never shut off. data will be lost. You also have our permission to fix yourself a sandwich in these cases too. we'll explain in more detail what these are for. You'll see a message like: Linux is going for system halt NOW . if you want to see what's on a floppy disk or a CD. you could do severe damage to your Linux file system. You're going to do cd /floppy or cd /cdrom If you try that now you probably won't see anything. we'll take her for a little spin. In the next lesson. For this. Shutdown for a single computer The most common way of shutting down a single user Linux system is for you as root to issue the command: shutdown -h now You use this when you plan on shutting your computer off at that moment. Linux will also run a routine check every once and a while automatically.
It will start to shut off programs that you're computer is using and you'll see it all happening. Using 'now'. (why would you want to do that?) you would use this command. it will tell you about it when it starts up and when it shuts down. Now you know the correct way to shutdown your Linux system. It won't give you a simple message telling you to wait and then another one telling you you can shut it off now. if you are having a problem. If you don't know how to solve it. That way. you may want to try using some time options instead of just now. You will get a similar message as with the -h (halt) option that will say something like: System going for reboot NOW The basic reason behind all of these messages is that Linux was conceived to be a networked operating system.Lesson 5 Virtual Terminals . shutdown -h 20:01 Which will shutdown the computer at 8:01 PM. For example. It lets you see everything it's doing. Getting Started with Linux . you must wait until you see the message: System halted or Power down before you shut off the computer. would probably be hazardous to the health of the person who sent that command. You have people at workstations on the network busily doing their work. If something is causing a problem. You could also try: shutdown -h +5 That shuts down the computer in 5 minutes time. That's because Linux is a transparent system. you may want to try shutting down the computer at a given time. but on a network system this would be changed to indicate a time. The next time you shutdown your system. Re-booting the computer The other command that you will probably use is: shutdown -r now If you have installed a dual-boot system and you want to use the other operating system. you may be able to track it down. The last part of the shutdown command now is fine for a single-user home PC. in a network. In the next lesson we'll talk using the system again. you can tell another person what you saw and he or she may be able to help you. That way people would have a chance to finish what they were doing before the system went down for maintenence. With the shutdown -h now command.
The combination CRL-ALT-F6 will get you out of your windows manager momentarily so you can login as a different user. Pretty cool.org suite's word processor. The text editor "vi" . This gave us the opportunity to have various programs running at the same time. With a computer and a word processing program. KWord. Linux is a true multi-tasking. or as the same user. 'root'. and then press ALT-F1 again to get back to your original terminal . First. Pressing ALT-F7 will get you back to your windows manager again. You'd just type the root password and then you can do stuff as 'root'. but then we can add the concept of multi-user to it. in this case. If you've been experimenting with your windows manager already. if you were working as a user. you can work as more than one user with more than one program at a time The ALT-F keys Let's say. The main use of a text editor is for writing something in plain text with no formatting so that another program can read it. Back in the days of MS-DOS. 'bob' for example. A preview of virtual terminals in X-window It's true that the 1990's brought us the era of the graphic user interface. wouldn't you say? The combination of ALT. the program will run one way or another. but to run a different program. multi-user system. white out and crumpled up paper has disappeared forever. popularized by Macintosh OSes and Microsoft Windows. cross outs.There are several excellent word processing programs for Linux like AbiWord.One of the coolest things that Linux has to offer is the concept of virtual terminals. You wouldn't have to shutdown the program you were working with. Linux in non-graphics mode may resemble MS-DOS somewhat. Linux comes with several. we should talk about the terminal mode text editors that are available for Linux. The X-window system of Linux will let you do this as well. Why use a text editor? A text editor is just like a word processor without a lot of features. We'll mention this again in the lesson on Xwindow. I would definitely say for writing. Unlike MS-DOS. Based on the information it gets from that file. part of the KOffice suite and the OpenOffice. but that's where the similarities end. All those old Smith-Coronas got put away. Getting Started with Linux . You could just press ALT-F2 and Linux will prompt you to login as a different user. All operating systems come with a basic text editor. Linux is just as well suited for word processing as any other operating system. plus the F keys will allow you to login as a different user. one program could only be run by one user at a time. We'll talk about these kinds of programs in a later lesson. and you found that you needed to do something as 'root'.Lesson 5 Text editors in Linux If I were to choose one of the main reason why people use PCs. you might want to try one more thing. All you then need to do is type: 'exit' when your finished.
This is a program that comes from UNIX. it would have been called 'hroth'. If you press ESC ':' 'q!' with an exclamation point. Getting Started with Linux . Vi may protest if you've written something and you don't want to save it. Using 'joe' 'joe' was created by Joseph Allen. you could type: joe tryjoe'. you have to press ESC and the 'i' key (i for insert). Even if you don't press 'ESC-i' it usually gets the idea that you want to type something and lets you do it after a few keystrokes. To write something. We should go through some basic 'vi' commands. You have to remember a lot of key combinations to do stuff that other text editors will do for you more easily. There is a more recent version called 'vim' which means 'vi improved'. press ESC. I suppose if his name had been Hrothgar Allen. quit) wq To quit without saving. To use 'joe'. on your own terms and in the privacy of your own home. because I have found that 'vi' is good if I want to get into a text file quickly and change something or I want to write a short note to myself. ESC the colon key ':' then (write. Actually. or more like a sesame seed. They're like 'vi' in that you use them to create and edit non-formatted text. There are a lot of commands in vi and you may explore those on your own at a later date. vi will accept it and not save your changes. they are two other text editors that I like and I think are a little easier to manage. You should get used to the 'ESC-i' keys so you don't end up writing 'ar John' instead of 'Dear John'.Lesson 5 'pico' and 'joe' pico' and 'joe'. That's vi in a nutshell. you can always erase your mistakes with the backspace key. ':' then 'q'. but they're a little more user-friendly. . so that's why it's called Joe. Working with 'vi' Let's make a text file. but there are people who swear by 'vi' and do all kinds of things with it like designing entire websites.The most popular text editor for Linux is called 'vi'. Type: vi tryvi You'll see a line of tildes down the left side and the name 'tryvi' at the bottom and [new file]. you would press ESC. To save this file.sounds like a comic strip. Press ESC + 'i' then type: hello vi If you wrote jello vi or jello bi or something I don't want to know about. I generally do not use "vi" for anything that requires more than about 30 seconds of work. you would press ESC then the colon key ':' then 'w' (write) To save the file and quit vi. The problem with 'vi' or 'vim' is that a lot of people don't like it.
CTRL-K-X. To save and quit. The most common commands a computer receives are ones to copy files. It looks a little friendlier. 'joe' is a very good option for writing those short text files that you'll need. press CTRL-K-D. Try writing anything you want. move files around. You can just start writing anything you want. The most important of these is CTRL-K-H which gets you 'help'. a shell is just a way for your computer to receive commands. press CTRL-x Pico will always ask you if you want to do what you're doing. To save the file. If you type: 'pico trypico' You'll see the commands you need in 'pico' specified at the bottom. Using 'pico' 'pico' is another friendly text editor. it will save the previous file with a tilde on the end. I could always fall back on the tilde file. Why you need to use a shell As I mentioned in a previous lesson. we're going to need to use one in order to make our work in Linux a little bit safer and easier. To save and quit or to just quit. Help shows you the key combinations to use with 'joe'. like 'tryjoe~' That little tilde file has saved my life a couple of times. The most important thing about 'joe' is the logical concept that you can just start writing if you want. (without the K). Well. list files and delete files. Popular operating systems have perfected this to such . this is our little overview of the main text editors available for Linux. (well. In our next lesson. If you want to see the other features of 'joe'. To save it. Getting Started with Linux . To quit without saving. My favorite little added feature of 'joe' is that if you edit a file again. That's good. The most common shell used for working in Linux is the 'bash' shell.You won't see the tildes like vi. maybe not my life) But it has saved me a lot of work. press CTRL-o. All the other commands you'll need are at the bottom of the page. Can you say that ten times fast? How about 'Shells in Linux'? That's not as difficult. Learning to use shells in Linux isn't going to be difficult either. as I mentioned before. CTRL-C. Our lesson will deal with that one. The majority of joe's commands are based on the CTRL-K keys and a third key. Questions like that will keep you from sending a file into non-existence without wanting to.Lesson 6 Shells in Linux Sea shells by the seashore. I've made some changes to a file and then found out that wasn't a good idea. which is a copy of your previous edit. press CTRL-K-H.
Then the -v would show you where it went. And sometimes you do! The '. They are: alias cp='cp -v -i' alias rm='rm -i' alias mv='mv -i' Let me explain them. you can modify a command with a dash '-' and a letter To see where the . An 'alias' in this file are some lines that you write so that your bash shell assumes that one command is really a variation of it. you could type cp -v -i.bashrc' file. but anybody who's seriously thinking of using Linux on a day-to-day basic should be familiar with the commands that you type in by hand. .'an assumed name'. including those that start with '. 'mv' is for moving files to a different place or renaming a file. so that it asks me if I really want to delete that novel I just wrote.bashrc file to keep me from getting into trouble. 'rm' is the remove/delete command. As you already know. because in the bash shell there is really no 'trash' bucket to pick it out of if you delete it. this means gone forever [cue ominous organ music] You obviously have to be very careful with this one. you actually get 'ls -a'. For example. Everybody knows what 'alias' means. Some of these aliases may be very important to keep you from sending that novel you just wrote into non-existence by accident.' If you find yourself using these '-letter' combinations a lot. That's why I've added the -i (interactive) command to my alias. you can modify your . -i for interactive) and it would ask you if you really want to do it in case there's another file by the same name.bashrc' An introduction to aliases In that file. so you could create an alias for it in your '. In order not to copy a file to a place where there's already a file by the same name. The best way to find it is to type. You'll find a lot of files on the system that end in 'rc'.bashrc' (ls lists files) You can open that file with vi. (-v for verbose. 'ls . Some people see this as a throw back to the old days. like 'ls'. 'cp' is the command to copy a file to another place or to make a copy of a file under a different name.bashrc file was. in your home directory you would type 'pico . as we talked about in the last lesson. you could have typed 'ls -a' and that would have shown you every file in the directory. joe or pico.bashrc file so that even though you type the simple command. I have an alias for it for the same reasons as the 'cp' command. Those files allow you to configure a certain program to run just the way you like it.a degree that they have graphic interface programs to do all this for you just by moving the mouse around and clicking on a few buttons. I see it as a way to have more power over your computer because even those operating systems that are billed as more 'user friendly' have provided you with a shell. I have a couple of entries in my . just in case you need it. In Linux.bashrc' file Before you start using the 'bash' shell you should be aware of a file that sits in your home directory called '.bashrc'. you can add something called an 'alias'. This is probably a good idea all the time. Linux has these programs too.
Adding aliases to the . 'cd' command To show the student the basic uses of the 'cd' command The first command you'll use is 'cd'. delete.bashrc file Well.bashrc your aliases will be ready to go. You can use them both in text mode or in your x-terminal when you're in graphics mode. move and rename files by way of a graphic user interface like Konqueror. We talked about this in a previous lesson. easier shell environment. It would be a good idea to add this line first. And finally mv='mv -i' So you're aliases will look like this # my personal aliases alias cp='cp -v -i' alias rm='rm -i' alias mv='mv -i' Save that file and logout and login again. . you can copy. Now your shell's ready to go. There is also a short-cut. If you type: source . 'cd' means 'change directory'. It's known as a 'comment'. If you type logout and then login again. Then you would add: cp='cp -v -i' on the next line write: rm='rm -i' so we don't send anything into byte heaven without a warning. Now you have a safer. As you get more proficient at Linux. Typing: cd /[directory name] will get you into one of the main directories in Linux. you now have '. so we're going to teach you the ones that you're most likely to use. you can add more aliases as you see fit. your aliases will work.bashrc' open in 'pico' or your new. But as I mentioned before. favorite text editor. so you know what you've done. Getting Started with Linux . shell commands are pretty standard in Linux. so let's review the basics.Lesson 6 Frequently Used Shell Commands If you install a window manager like KDE. # my personal aliases The pound sign (#) tells the shell not to read that line.
Typing cd without the / and a sub-directory name will get into that subdirectory. are file permissions.1 bob users 103824 Jul 10 12:01 waikiki. That basically shows what you and others are allowed to do with the file. 'bob'. you have the name of the file. The next one represents that Linux. starting with any file that begins with a number. You don't need to separate the parameters either. Other parameters with 'ls' Now let's add some more parameters on 'ls -l -t' will give you a listing according to the time with the newest ones appearing first in the list. The numbers are the size of the file in bytes. 'ls -l' will give you a detailed listing in alphabetical order. 'ls -l -t' and 'ls -lt' are the same thing. The next one that it belongs to you. Typing 'ls' will list the contents of a directory with just information about file names. like read it. Normally we'll want to add on some parameters (those -[letter] combinations) so that we'll get some more detail Using 'ls -l' To show the student how to get some more detail with 'ls -l' 'ls -l' will get you a detailed listing of the directory like this. We'll go into that in the next course.Typing cd . We'll go into that in a later lesson. If you type just: cd you'll go back to your home directory The 'ls' command To show the student the various variations of the 'ls' command 'ls' is another command that we've discussed a bit before.jpg.. modify it or make nasty comments about it. Remember. will get you out of it. Lastly. If you want the oldest to appear first. not only recognizes users. you don't have to type the whole name Typing: 'cd' and the first letter or letters of a directory and the TAB key will complete it for you. Then all you have to do is press enter. Please do not use the cuneiform alphabet unless you're from ancient Mesopotamia. -rw-r--r-. You can use 'ls a*' to list the names of all the files that begin with the letter 'a' and so on down through the alphabet. then any file that begins with a capital letter and then any normal file that begins with a lowercase letter.txt' that'll be the first one you see. So if you have a file '007_secrets. those letter. Let's go into some more detail. try: 'ls -ltr' .jpg The first part. The next one shows that you've got 1 file. but also groups of users. You have the date and when it was created or modified or copied there. which is obviously your important tax records. waikiki.
There are a couple of parameters in capitals that you may want to use. 'more' and 'less' To introduce the student to these commands 'more' is a command that you can use to read. You don't have to do that if you don't want. You can't do that with 'more'. so once you get used to the colors. programs end in '. Linux is also color coded. now you know: 'ls -lXr' There is also a parameter that will help you if you want to find out more about these commands or any others. you'll know what the file is about. as you know. If you don't know what some particular file contains and you're curious about it. it's 50/50. We'll talk more about 'more' in this lesson when we use it in combination with other commands 'less' is better for viewing files. It's attached to an e-mail message and it says 'stuff'.extension. they don't have to and probably won't. You can see what type of file it is by typing: 'file stuff' You may see something like this: 'stuff: ASCII text' This means that the file contains plain text.exe'. but not really ideal. if you get my meaning. for example. You would type 'more stuff' to see the jokes. 'ls --help' will give you details of all the possible variations for this command. what's written in that 'stuff' file that Tony sent you. in Linux. You can scroll back up to see the whole text if you want. In MS-DOS. Let's say your friend Tony. sends you a file he says is really neat. If you have any that end in *. 'ls -lS' will list your files from biggest to smallest. It's probably some jokes or his favorite chili recipe.zip. type 'less stuff' to see Tony's jokes again Again. Press the 'q' key to stop viewing the file It's useful for this. 'ls -lX' will list files according to type in alphabetical order. 'ls -lSr' will reverse this order.like 'novel.txt') that told us what kind of a file it was. press the 'q' key to stop viewing the file . the one with the magic markers. MS-DOS got us all used to the idea that a file had to have an extension (file. In Linux. then those will be last.The 'r' is for reverse order. you can use this command to get some information about the file. If you want those to be first. The 'file' command File is an interesting little command. 'less' is more than 'more'.
you may want to create a directory to keep Tony's files You could make the directory for Tony tonyd (Tony's last name is Dweebweiler) mkdir tonyd then you can do: cp stuff tonyd Remember use your TAB key to save time. you may want to work as two different users for two different jobs. You may also use the command cp -r /home/bob/tonyd/ ~ with the tilde wherever you happen to be and that will automatically copy the directory 'tonyd' to your other home directory.Lesson 6 The 'cp' command To show you how to copy files with Linux We talked about 'cp' in the lesson on aliases. where you work as 'bob' As 'fred'. You'll be able to tell the difference between the two files because the copy of 'stuff' in the directory 'tonyd' will show a different time. You'll have the original 'stuff' in your home directory and then the copy in /home/[your name]/tonyd/.you didn't move it there. Now you're going to have TWO files named 'stuff' because you copied that file to the directory 'tonyd/' .Getting Started with Linux . You may be working as 'fred' and your directory 'tonyd' is in the directory /home/bob. if you saved Tony's e-mail attachment to your main /home directory. Let's go back to Tony's 'stuff' file For example. If you had used the command cp -p instead of just cp you would end up with two identical files in two different places. You can also copy entire directories to another place. ./ to copy the directory 'tonyd' to your home directory. If you use the command ls -l stuff on both files. /home/[your name]. If you don't want that. you'll see this. 'cp' is for copying files from one place to another. Now let's talk about two more basic uses of the cp command and some short cuts. We'll talk about that shortly. or for making a duplicate of one file under a different name. More uses of the 'cp' command To show you how to copy directories and create duplicates of files. there's a better way of doing it so that 'stuff' is only in the directory 'tonyd'. you can use the command: cp -r /home/bob/tonyd/ /home/fred/ If you're in your home directory you can use this command cp -r /home/bob/tonyd/ . That's the mv command. As I mentioned in a previous lesson.
. Just imagine: "The number one bestselling book this week is 'Book' by John Author. You do not have to use the 'r' option as you did with 'cp'. Spaces are sort of 'faux pas' in Linux but not 'verboten'. You can do it and Linux will accept it but it will put a \\ between the different words. For example. 'mv' sort of has a split-personality because it serves these two functions at the same time. You should probably re-name this file to something meaningful. 'mv' command for renaming files Let's go back yet again to Tony's file.Lesson 6 The 'mv' command 'mv' is a command that we're going to use to move files around or to rename them. Getting Started with Linux . 'stuff' again. .. You may want to add some more jokes and then pass it along to another person You could do this: cp stuff stuff2 or choose a name that's meaningful for you other than 'stuff2' Now you have another file that you can add jokes to while you preserve the original file. It's there because Linux doesn't really like spaces in the file names. Now we'll look at the command 'mv'. I would suggest doing something like this: mv stuff tonys_jokes You may have noticed the underscore '_' in the title.The other use of 'cp' we talked about was to get a copy of a file with a different name. Tony's file 'stuff' is loaded with jokes. Moving files with the 'mv' command Now you can use the 'mv' command to move Tony's jokes into the directory you made to keep his files. (if you have another friend named Tom and you like to cook) You can also move entire directories with this command. It would be to your advantage to use '_' between words though. You would just substitute the file name for a directory name mv tonyd/ my_friends/ would move the directory 'tonyd' to the directory 'my_friends'. 'stuff' is not a good name for a file just as 'book' isn't a good name for a book." Always remember to use that TAB key and the up and down arrows to save yourself some time. You can open it in 'pico' and start writing: "Why did the chicken cross the road. mv tonys_jokes tonyd/ If you do cd tonyd and then ls to* you will see his file there along with 'toms_jokes' and 'tomato_soup_recipe'.
Now you know how to use 'mkdir'. . Then you're free to use 'rmdir' So. you could type mkdir --verbose my_friends and it will tell you that you created the directory. oblivion. the directory has to be empty. You can even use it to create a directory called 'my_enemies' if you're into that sort of thing. So. Getting Started with Linux . The correct use of 'rm' So you have to be careful with 'rm'. you have to use your 'rm' command on the files first to remove them or use 'mv' to get them into another directory. let's create it with another command. next we'll deal with the 'rm' command.Lesson 6 The 'mkdir' command 'mkdir' is the command for making directories. you would type: mkdir my_friends There are no whistles or buzzers. the people who wrote these programs tried to give them names that described what they do more or less. Using the 'mkdir' command To create the directory 'my_friends' that we talked about in the last lesson. As you have noticed.it gets rid of directories. 'mkdir' may be familiar to MS-DOS users out there. sending them into non-existence. That's why we put an entry into our '. not as long as 'makemeadirectoryplease' and not too cryptic like 'xr77b'. It should be pointed out that in order to use it. If you'd like some sort of acknowledgment. The 'rmdir' command 'rmdir' is the opposite of 'mkdir'. If you copied or moved anything to 'my_friends' and you typed rmdir my_friends/ Linux would politely tell you that you can't do that. That means.Lesson 6 The 'rm' command 'rm' is for removing or deleting files. bye-bye. If you type ls -l You'll see it there along with information about it.What? You don't have the directory 'my_friends'? Well. Getting Started with Linux .bashrc' file: alias rm='rm -i' so that it asks you if that's what you really want to do.
You may get 'y-itis' and just keep pressing the 'y' key.. rm: remove `bad_jokes'?: You would press the the 'y' key unless of course you remembered that you have a real good one in there and then you would answer: with the 'n' key. This is the first time that we're going to see a command that's meant to be used with other commands. Use the configuration tools provided in your version of Linux to un-install programs that you don't want. I have done that before. like when Valentine's day falls on Friday during leap year and coincides with a full moon. please be very careful when you're using the 'rm' command as 'root'. it will ask you. Getting Started with Linux . and because you made an alias.If you created a file called 'bad_jokes' and you wanted to get rid of the file. Let's try some plumbing.. one on top of the other. If you do this. Well. if you looked at the contents of your /proc directory with: ls -l /proc . Actually. That's adding the '-f' option on the end. actually. Plumbing with a computer? Well. That means that the pipe will separate two commands so that they will be done one after the other. There's another case of 'rm' that's potentially more dangerous than the 'rm *' case. you would type rm bad_jokes. Wait until you have some experience before you start removing files 'by hand' as 'root'. don't worry. another one 'note_to_myself1~' Then I decide that I don't want all of those ~ files littering up my directory and I innocently type: 'rm note_to_myself*' and then 'y' 'y' 'y' and then I realize too late and my brain types: 'Y did you do that!!' The problem is that 'note_to_myself2' contained my important plans for taking over the world and 'note_to_myself3' contained a note about how much money I owe at the dry cleaners. Also. 'rm' . For example. if you were in a directory and typed 'rm * -f' you would delete everything. Occasionally. any key other than 'y' is the same as responding with the 'n' key. but my dry cleaner's not going to give me my suits the next time unless I pay him. It just goes ahead and deletes the files in question. The location will vary on keyboards from country to country. we're going to do a little plumbing. you don't type: pipe. Maybe taking over the world can wait. when I've used the text editor 'joe' a lot I end up with a lot of files that end in a tilde (~).some words of caution You can also do stuff like rm b* with the asterisk. You get files like 'note_to_myself1' and if you've modified it. but I would use my best judgment with that. so if you accidentally type 'w'. For example. This symbol is like two vertical slashes. it's just a little witticism of mine because the command we're going to learn in this lesson is called 'pipe'. I generally use the '-f' option very sparingly. You press the '|' key. no questions asked. it will override the '-i' option and won't ask you anything.. and plumbers work with pipes.Lesson 7 Plumbing with "pipes" in Linux In this lesson. To use the pipe command. Linux is so flexible that it even allows you to do plumbing with it. You could do some very serious system damage if you delete the wrong files.
Use --sparse=never to inhibit creation of sparse files. So if we typed ls -l /proc | more you could scroll down with the ENTER key and see it all. it'll be a little easier to manage. You're personal directory in /home will fill up and pretty soon 'ls -l' will overflow in your terminal or x-terminal window. The manual is a file that shows you how to use the command and list the different options for the command in question. There are a lot that I think we're written by Harry Bigbrains and they were meant to be seen only by Richard Biggerbrain who's sitting in the cubicle next to him. Remember that in a previous lesson we said: "Less is more than more". You're probably going to end up using this a lot. ls -l /proc | less is a better solution because you can scroll up and down with the arrow keys. They make your work a little easier and give you added information about your system. this appears in the 'man' file for 'cp' By default. You would type: man [the command] For example. sparse SOURCE files are detected by a crude heuristic and the corresponding DEST file is made sparse as well. That is the behavior selected by --sparse=auto. Getting Started with Linux . 'man' . Managing documention in Linux The manual file for 'mkdir' is actually one of the more straight-forward ones. if you type man mkdir The manual file for 'mkdir' will come up and give you a detailed explanation of this command. You can also scroll up and down in a terminal with the SHIFT-PAGE UP / SHIFT-PAGE DOWN keys. I don't know about you. but I'm going to call my lawyer. Actually. you'll get a nutshell version of the 'cp' command. For example.it would be too big to fit in one screen. .manual pages in Linux The first command is 'man'. If you use your pipe cp --help | less. Specify --sparse=always to create a sparse DEST file whenever the SOURCE file contains a long enough sequence of zero bytes. I've been assaulted by "a crude heuristic".Lesson 8 How to get more information with Linux Now we'll talk about some other commands that you will probably need in your day to day work with Linux. This command will show the manual for a command or program. There's a little short cut if you've forgotten to use the pipe. If you use the command cp --help.
9:15 in the morning. You don't want to have it look like you did it in February. Of course.Lesson 9 Other interesting and useful commands The command 'touch' Now we're going to talk about a touchy subject. Apropos The word 'apropos' means pertinent to something else.set TERMCAP and terminal settings to current xterm window size xterm (1x) . if you punched in at 9:40. You can use 'touch' if your boss yells at you about not having a report ready at lunchtime. In fact. Make sure your digits match your story. There is a command that will show you all of the man page that may shed some light on a certain command. You can use your favorite Internet search engine to find Linux documentation in your own language. 'touch' can be used also to create an empty file. You would just enter touch [a file name].txt and it makes it look like you did it at 9:15. Some versions of Linux that are made for languages other than English will give you this documentation in its particular language.terminal emulator for X terms (5) . We'll deal with the uses of 'touch' in our later courses. You should quickly finish the report. You would then just choose one of these and type man terms for example.The 'info' format Typing info [command name] will get you more information on a command and is more current than most man files and perhaps a little more readable. then type: touch -t 05070915 my_report. if I typed: apropos xterm I would get something like this: resize (1x) . For example. The command 'touch' which is used to change the time and/or date of a file. Getting Started with Linux .change settings of an xterm These are all man pages related to xterm.database of blessed terminals for xtermset. There may be times in the future when you need an empty file that will be filled up later automatically by the workings of some program. so you may want to consult your own version of Linux about these files. There are also websites that specialize in documentation in other languages. then you're in trouble. The first four digits stand for May 7 (0507) and the last four (0915) the time. The 'info' files are not always installed automatically. some 'man' files will actually tell you to consult the 'info' file. Finding things with the command 'find' . xtermset (1) .
Your windows manager may have this incorporated into its find tool but then again. but most of us are going to have to find things now and then. create a file called 'mary1. just type in: find -name *hawaii* and find out where you put you pictures of you Hawaiian vacation. The two asterisks make sure it does that. you can use the find tool.Lesson 9 The 'grep' command In the last section we talked about the 'find' command which finds files. for example: find -mmin +0 -mmin -120 | less will find things that you created or modified up to 2 hours ago and the '| less' part will make it easier to read Getting Started with Linux .txt' . If you choose to use a higher number for -mmin -? you should probably use a pipe.There's so much on a computer's hard drive. Mr. For example. Spock. What does 'grep' mean? 'grep' is a Vulcan word that means "find". it will go through every directory and find every file that has the name 'hawaii' in it. Now we'll talk about the 'grep' command which finds words in files. Captain. It's very useful because it has a lot of options and you can use them to modify your searches. If you use a windows manager like KDE. let's say from now up to 10 minutes ago. you may want to find some file that you were working on. nobody could ever know from memory where everything is. Perhaps the smart lad who won the spelling bee by spelling 'prestidigitator' might be able to. If you're in your /home directory. How to use the 'find' command But if you're getting used to using command line stuff. but it sort of looks like it. A 'grep' mini-tutorial With 'pico' or any Linux text editor. The best way is learning by doing." Spock: "Grepping now. You may have created some file recently." * * Star Trek stuff copyright Paramount Pictures Let's have a little practice session with 'grep'. If they started with 'hawaii' you wouldn't need the first asterisk but you can leave it there if you want. doesn't it? Kirk: "Find the solar system L10J. find -mmin +0 -mmin -10 This will list the files that you created or modified within the last ten minutes. Actually it isn't. so let's do it. you could type. the beauty of Linux is having alternatives.
txt and enter the text Mary had a little cow. so phasers on stun and let's go.txt and type: Mary had a little too much to drink.txt will show up instead of mary2. Linux is a multi-user system.txt Then type: Mary had a little lamb Press CTRL-X in 'pico' (if you're using that) and it will prompt you to save. You may see something like this: . Type the following command: grep Mary mary*. You should get this output: mary1. For example. Typing grep drink mary*. Then create: mary2. Now we know what Mary was doing when she wasn't watching her lambs! Now save that file. But if you type the word "cow".txt Mary had a little too much to drink The word 'Mary' is in all of those files. It's been a pleasure 'grepping' with you! Getting Started with Linux . only that mary3. there's 'grep' in a nutshell.txt will get us more or less the same. You've created three files that start with 'mary'. now we're ready to try out 'grep'. so you'll get this output.txt Mary had a little cow mary3.Lesson 10 Power user commands Here is a brief overview of some other commands that you may find interesting at some point as you use Linux. They will help you to get all of the power out of Linux.txt. As you now know.txt you'll get the same output because the word "little" is also in each of those files. 'grep' looks for the word "Mary" in any text file that is called "mary(something).txt Mary had a little lamb mary2. Well. If you type grep little mary*. Even if you're using one computer at your home. you may be working as more than one person.txt: Mary had a little cow because the word "cow" is only in mary2.txt. Save that and create the file: mary3. you'll get this output: mary2. OK.pico mary1. so the asterisk makes sure that 'grep' will look for the word 'Mary' in all three. if you logged in as 'root' but are working as 'bob'.txt Let's explain this a little.txt". 'who' 'who' is a command to find out who's working on your system.
zip cartridge or whatever you used to make the backups. use the command: date >> directory_listing with two "greater than" symbols (>>) The two symbols will add to the file without erasing its contents The '2>' command . you may want to put a date on the file. This is mainly used in networked situations so the system administrator knows who's working. '2>' In the lesson on the pipe command. tape. The '>' command The "greater than" symbol '>' will do the same as 'tee'. 'tee' is used to write out what appears on your screen into a file. You could print out the file on a label and stick it to the disk. You might do this: ls -l | tee directory_listing to get a file with the listing of a directory. If you've placed files in a directory to be backed up. '>'. I think I'm going to resist the temptation to make some sort of golf reference here in the lesson on the command 'tee'. If you don't you will erase everything on the file in favor of whatever the second command was. I mentioned plumbing with Linux. ls -l > directory_listing will give you the same result. you could use this command to create a listing of that directory. Remember to use the -a option if you're going to write to that file a second time. It can be used by your boss to find out that you've come in late too. Getting Started with Linux . You will be using this with the after a pipe '|' . You don't need the pipe command (|) with this one. If you want to add the date at the end.root tty1 May 20 09:48 bob tty2 May 20 10:05 This is just Linux's way of saying that 'root' started working on terminal 1 on May 20 at 9:48 in the morning and bob started working on terminal 2 at 10:05. You may use it to find out if you've opened more that one terminal so that you remember to log out. If you're using the 'tee' command for the backups I described before. You can use this command: date | tee -a directory_listing The command 'date' will enter the date and time in the file at the end.Lesson 10 'tee'.
If you decide to download any program from the internet. forget who you are! 'whatis' To show you how to use the 'whatis' command 'whatis' is a command so you can find out what a program does. You will probably not be using it a lot because we all know how perfect Linux is and how few errors there are when you're using it.gz It shows you where the command is as well as the location of its manual file.Lesson 10 'whoami' whoami is a nice little program that tells you who you are. juice: nothing appropriate. but it's not all-knowing. that program may need other programs in order to work. But every once and a while you may want to download some software from the Internet You install it and . So if your user name is bob and you type whoami you'll get: bob This comes in handy if you switch terminals a lot and work as a different user.1.print lines matching a pattern Linux is good. in terms of computer use anyway. just in case you didn't know already. you will find a lot of programs and you may not know what they do. You could just do something like this: [program X that doesn't work] 2> program_X_error You create a file with the error message. and you would get this: grep (1) . your user name. If you explore your Linux system. basically telling you that Linux has no idea what orange juice is 'whereis' whereis is a nice command for finding other commands or programs. the number two (2) with the "greater than" symbol >. . you would type: whereis pico and you may get this: pico: /usr/bin/pico /usr/man/man1/pico. that is to say. You amnesia victims are in luck! Actually it tells you who you are in terms of how Linux understands who you are. is used for creating a file for an error message that you may get.whoops! there's some error. He or she would also like to know about it and will probably help you fix it. If you want to know whether or not you have it. you can type: whereis [program name] and find out.This command. You could show it to someone who might know what's missing or you could send it to the author of the program. so if you type: whatis orange juice You will get this message: orange: nothing appropriate. You would simply type: whatis grep for example. Getting Started with Linux . You may not have something installed that the program needs to run. If you wanted to find out if you have the 'pico' editor and where it is. You may.
so if you type whereis Harry Linux is just going to say Harry: 'which' To show you another tool for locating programs 'which' is similar to 'whereis'. You could use 'echo' in those scripts to tell you what the script is doing at any given time. It will give you the location of a program. if you type this in your terminal it will not show you the way to the 'facilities'. . It will need to know its location or "path".note to make yourself a reminder for the other reminder note. A software developer may have designed his/her program to access Java.note or less remember_gates. Unfortunately. a program may need Java to run it but thinks its in another place. At times.note Will make you a nice reminder note about dear 'ole Bill.whereis isn't designed to find people. I sometimes use it to write short notes. or to prompt you to do something. like enter text.Lesson 10 'echo' To show you some uses of the 'echo' command 'echo' is a little command that repeats anything you type. you've got a poor-man's post-itnote. There is really no need to do that under normal conditions.note to read your notes 'wc' People following this course from Europe may recognize this as the symbol for 'bathroom'. for example. If we use 'echo' along with 'pipe' (|) and 'tee'. a program may not find another program it needs to make it run. You may find 'echo' useful in the future if you start writing "shell scripts" which are like little programs that you could use to do a few commands at one time. As Open Source software will always let you modify configuration files to get your program working according to your needs. There is a practical use for 'echo' in everyday life. Use less bill_gates. For example. For example: echo remember to tell Bill Gates he owes me 5 bucks | tee -a bill_gates. Just remember to read your note. Getting Started with Linux . You would simply type: which java and Linux will inform you of its location /usr/lib/java/bin/java This is a handy command because some locations of programs vary from one version of Linux to the next. from a different location. For example if you type echo hello Linux will display the word 'hello' . You could type: echo remember to open Gates note | tee -a remember_gates. you can get the program to work for your system. Shell scripts will be taken up in a later course.
note As you can see. If you do any downloading or uploading of files via FTP by way of a non-GUI FTP program in your terminal. I once ran into a case where the remote computer didn't recognize the ls -l command. then I'd consider buying lottery tickets) Thu Sep 7 20:34:13 CEST 2000 You probably get everything here. words and letters (characters) in a file and in that order. Just type: date You'll get this: (or something like it.Actually. then I owe 439 people money. actually. For example. That stands for 'Central European Standard Time'.note I will get this output: 439 6510 197120 wc people_I_owe. There are 6510 words and a total of 197120 characters. If I type: wc people_I_owe_money. there are 439 lines. this command will give you the number of lines. you will recogize the 'CEST' part. I just typed in dir and that did the trick. so you know exactly where you are. I might add that this is a good tool for people who write letters professionally and get paid by the word. dir=ls -l. so that means if each line represents one person. you may find this command useful. Let's go back to the file about the people I owe money. If you're living in central Europe. It will give you the same result. If you get the same thing as I do. Actually.Lesson 11 Miscellaneous commands These might come in handy from time to time 'dir' The people who traveled down the MS-DOS road will know this one. Then I fired off a nasty e-mail asking why in the world they weren't using Linux! 'pwd' The command pwd will show complete information on the directory you're working in. Getting Started with Linux . if you type pwd you may get something like this: /home/bob/homework which shows you that you're in the directory 'homework' in your user directory as 'bob'. 'date' Did you forget your wedding aniversary? Your boyfriend or girlfriend's birthday? Tax day? (everyone wants to forget that one!) No need for that to happen anymore with Linux. Linux recognizes .
type: date +%T To see on what day Christmas falls this year (really. exit will close the X-Terminal you're working with exit with the option "stage right" will get you an error message. That was good luck for him because that way he got to relax for the weekend. Just for fun. in the nice standard calendar format. type: date +%D To see just the time. I'm not kidding!). Consult your manual file ('man date') or ('info date') 'cal' Typing cal will give you the calendar of the present month on your screen. If you type: cal 12 2000 You'll see the calender for December of 2000. If you add the option cal -m. If you're working in text mode. unfortunately. you can get out of a terminal with the exit command. There are many other options. as it is preferred in many countries. 'exit' As you can guess. Substitute any year you like. typing exit will prompt you to login again. If you're in x-windows. If you type: cal 2000 You'll get the entire calendar for the year 2000. There are a lot of useful options. the week will start on Monday. Getting Started with Linux . use logout instead. I typed cal 10 1492 and I found out that Columbus discovered America on a Friday. If you want to work as another user.world time zones and you set this up when you installed Linux. To see just the date. If you live on Mars. you're out of luck. type: date --date 'Dec 25' and you'll get the day that Christmas falls on this year. There are other uses of the 'date' command.Lesson 12 Becoming a super user . Substitute that for any date that you'd like to see. Substitute any year or month you like.
If you type: last You may get something like this: fred bob root reboot tty6 Thu Oct 5 16:55 . there are many programs that run graphically that will inform you of the space available on your Linux partition. you could fire off a nasty e-mail to him about mis-use of your server. His address. you worked as 'fred' for 3 hours and 10 mins. by the way. Once again. If you type df You may get something like this. non-graphic way to keep track of your hard disk space. it's time to get down to your local computer shop and buy a new hard disk.) Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hda2 481083 408062 48174 89% / if you start seeing a 'df' output like this. But this is a very good. is "thedevil@hell. This is a good way to see who's been using the computer if it's networked.The following commands are frequently used by systems administrators to keep an eye on what's going on with their systems 'last' The command last will show you the people who have logged into the computer today and the terminals they are/were using. By typing: free and you will get something like this total used free 14452 13904 548 shared buffers cached 28208 492 7312 Mem: .16:43 (0:20) system boot Thu Oct 5 16:22 As you can see. You'll see it's somewhat pressed for space. Anyway. 'free' 'free' is a command that you can use if you want to know how much RAM memory you have free on your system. For example. You worked as 'root' for 20 minutes (probably some administration tasks) and you booted your computer at 4:22 PM. You are still working as 'bob'.20:05 (3:10) tty1 Thu Oct 5 still logged in (3:10) tty1 Thu Oct 5 16:23 . 'df' is a good way to keep track of this. if you saw a an entry for 'satan' and you hadn't given the Prince of Darkness permission to login. (This is actually taken from a system I use for testing versions of Linux. quick.com" 'df' 'df' is a command that you're going to use a lot if you're pressed for hard disk space.
You could exit that program and then type free again to see if it was the culprit. that's not the kilobyte figure.3 0:04 netscape 386 bob 1 0 768 768 596 R 0 0. I owe a lot of people money.note I'll get: 197120 people_I_owe_money. It's probably best to use the option du -b (-b for bytes) and it will give you the exact figure in bytes. it's a big file.6 0:09 X 350 bob 4 0 13144 11M 7728 S 0 2. It will give you a pretty complete list of everything that's going on in your computer.12 0 stopped 88. Let's look at a couple of examples: If I type: du people_I_owe_money.3 6.5 1.0% nice 22672K shrd 0. Linux's memory management is quite good but a certain program may be "hogging" memory. 'du' shows the closest kilobyte figure. you may find out that your memory usage is high using this command. 'du' 'du' is the way to see how big files are. On the other hand look at the output for 'people_who_owe_me_money.2 0:00 top . You can use it on a directory or on a particular file.note As you can see. whichever you prefer top To show you the use of the 'top' command.note': 1 people_who_owe_me_money.note I may get an output like this: 194 people_I_owe_money. Here's a sample output of the 'top' command: 9:09am 34 processes: CPU states: Mem: 62972K av up 4 min 2 users 31 sleeping 3 running 11.1% user 0.7% system 50420K used 12552K free load average: 0 zombie 0. This is another command I use a lot. 'top' is designed to show you how your CPU is being used.06 Swap: 1020116K av 3152K used 1016964K free 27536K cached PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND 332 root 12 0 4492 4184 1480 R 0 8. and it will list the files and subdirectories and give you the byte or kilobyte count. if a program is running particulary slowly.7 19.-/+ buffers/cache: 6100 8352 Swap: 33260 1556 31704 Sometimes. if I type: du -b people_I_owe_money.4% idle 5312K buff 0. By default.13 0.note But instead. Here you will see what processes are running 'top' is a good command to use when you want to see what your system's doing.note No. That's the byte figure! You can also use this on a directory.
This is the user mode and your user name will appear in the first column.2 0. there's more than that.xinitrc-/usr/X11R6/bin/fvwm2 /usr/X11R6/lib/X11/fvwm2/FvwmButtons7 4 .0 0.8 1.6 0.ugidd syslogd klogd atd inetd lpd Getting Started with Linux .0 0. you can type ps -u. Getting Started with Linux .0 0. you can type just ps -a and try to guess who's using the process. It may look like this: PID 293 1436 1437 1445 1449 1459 1461 1462 1464 1472 1730 1731 1760 1781 TTY 2 2 2 2 2 2 2 2 2 2 2 p1 2 p1 STAT S S S S S S S S S S S S S R TIME 0:00 0:00 0:00 0:00 0:01 0:00 0:00 0:00 1:27 0:00 0:00 0:00 0:01 0:00 COMMAND -bash sh /usr/X11R6/bin/startx tee /home/bob/. If you're not using a networked computer.0 0.5 0. If you're into detective work. You can see other users processes if you type ps -au.0 0. the time you started running the processes and others.0 0.0 0.fvwm2rc 0 8 xclock -digital -FONT10x20 -geometry +520+550 /usr/X11R6/lib/X11/fvwm2/FvwmPager9 4 .0 0.4 0.0 0. you will see yours and root's processes. There will be other columns about memory usage. Actually.X.0 1.0 0. Just typing ps will give you the processes you're running as a user.8 0:00 0:02 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 FvwmButtons init kflushd kpiod kswapd md_thread update portmap rpc. We'll get into why these are so important in the next part of the lesson.fvwm2rc 0 8 0 0 & /opt/netscape/netscape (dns helper) xterm -FONT 8x13 -backgroundWheat -T xterm-1 bash emacs ps If you happen to forget what your name is.4 0.0 0.1 0.0 0.0 0.345 1 2 3 4 5 48 137 141 157 161 212 225 258 bob root root root root root root bin root root root at root root 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 972 168 0 0 0 0 136 300 292 512 692 304 424 580 972 168 0 0 0 0 120 296 264 508 688 276 416 548 704 144 0 0 0 0 96 228 212 412 296 220 348 428 S S SW SW SW SW S S S S S S S S 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0.err xinit /home/bob/. The information that you'll probably be most interested in is the column that shows the "process ID" or "PID".0 0.0 0.0 0.1 0.Lesson 13 Commands to control your system ps 'ps' will give you a list of the processes running on your system.4 0.Lesson 13 .
but good as an example) It will just start finding everything. PID 293 422 437 438 441 TTY STAT TIME COMMAND 2 S 0:00 -bash 2 S 0:00 sh /usr/X11R6/bin/startx 2 S 0:00 tee /home/bob/.err 2 S 0:00 xinit /home/bob/.xinitrc -2 S 0:01 /usr/X11R6/bin/evilaliens Let's say you're trying a new game that was just ported to Linux .Lesson 13 . first. In the last part of this lesson we talked about process IDs or "PIDs". If the 'exit' button doesn't work. To do this.'kill' "kill" is a very explicit word. Here's a little trick. you can just type: killall evilaliens and that should also do the trick. there's no need to use the 'kill' command. If you're working as 'root' and you need to use the 'kill' command. it's a good idea to run ps -au and look closely at your PIDs. If you don't want to do two steps. Now you can't exit the program either. It implies 'death'. Well. you can 'kill' it. (Kind of an absurd thing to do. When you use 'kill' as root. You don't want to end up killing some process that you need. Try typing this: find *. along with all those nasty aliens. in my example. The game is called "Evil and Nasty Alien Visitors".X. The name of the "binary" or program itself is called evilaliens. you can use the keys CTR+ C to stop the 'find' process. you can terminate a program. Getting Started with Linux . you are the 007 on Her Majesty's Linux Service. You have license to 'kill' the process you desire. as I mentioned before. Using 'kill' as root Remember that when you work as root. The aliens just took over Oklahoma and you swore you got them all. you would type ps and you would get this output that we talked about before. (or at least the computer). A good example of this is when you try a new program that hasn't got all the bugs worked out of it yet. you kill the program. If you have done something like this by mistake. you are the all-powerful master of the universe. You're playing in your x-windows enviroment and you have an x-terminal open (probably the one you typed 'ps' into). You would just type: kill and the PID number. 'ps' and 'kill' and you know the name of the "binary" or program itself. In other words. Another way to kill a process. (the last one on my 'ps' example) It's a beta (i. 441. In these cases. with the command 'kill' plus a PID. That is: kill 441 and the program disappears.e check it out and tell the author what bugs are still in it) version and the game starts giving you problems. programs that may not let you exit regularly. You will probably only use this with troublesome processes.
if you would like to use floppies. At one point.File systems in Linux This is a beginner's course and one of the concepts that newcomers to Linux find different is the idea of a file system in Linux. If that person is a Windows user. You have to be working as 'root' to be doing this. your floppy drive. though floppies are becoming somewhat obsolete. . As we mentioned in the first part of the course. we should talk here a bit about the type of file system Linux uses. Linux users that use KDE or GNOME can also copy files in that way to different parts of the hard drive. you may want to store some files on a floppy or access data on a floppy that someone has given to you. from Windows 95 on up uses a file system called 'vfat' Linux uses a different system called 'ext2'. That is to say. which is known to Linux as "fd0" (floppy drive 0). You would use a command called 'mount' to do that. However. On the same idea. you might have to access files in the Windows partition of your hard drive. If you want to copy data from your Linux partition to a floppy. We'll explain this command in later lessons. then you would have to indicate once again that the file system is 'vfat'. To create a linux floppy "by hand". If you want to copy Linux files to a floppy to be used in another Linux machine or to be used by you later in Linux. There are also other types of file systems out there. We should also say now that this is considered an administration task. MS-Windows. then it might be better to format the floppy for Linux's ext2 file system. You would also have to indicate as an option in that command that the file system you want to access or "mount" is a Windows 'vfat' file system. you can use commands such as 'su' to do the work of root on certain occasions when you're not actually working as root. everything is a file in Linux. Formatting a floppy for Linux Most floppies sold on the market are pre-formatted for MS-Windows. You will hear the customary noise of the floppy drive (some are louder than others some older ones that I've heard sound like a chain saw) and you will get some output like this: Linux ext2 filesystem format and some other information about the size of the floppy etc. you would have to format and then "mount" the floppy as a Linux 'ext2' file system. MS-Windows and Mac users are used to clicking on an icons and dragging the files they want copied to a floppy or another part of the hard drive. As you get more familiar with Linux. You may have chosen to have both Windows and Linux installed in your computer. the way data is stored and managed in Linux. including your floppy drive. The other part is the device. You would also have to use the command 'mount' before you copied data to or got data from a floppy disk. You can copy data from Linux to a Windows formatted floppy with no problem. you would place a floppy in the drive and type: mke2fs /dev/fd0 The command is an abbreviated way of saying "make an ext2 file system".
in other words. If you don't. change the option to -t vfat in your root directory (you can get to it by typing: cd /). you should create it (mkdir floppy). incorporating it temporarily into your Linux file system or. the method behind this is quite different from other OSes. the floppy type (indicated by the option -t) is a Linux formatted floppy. Some don't. You may want to run this command to check if the floppy has defects e2fsck /dev/fd0 Some windows managers have a nice program to do both the formatting and the checking of the disk at the same time. for example). Let's explain what we've just done here. to copy to and from the floppy disk. When we typed: mount -t ext2 /dev/fd0 /floppy we told Linux that our floppy disk is now part of our Linux file system (/dev/fd0) and that any files we would like to store on that disk will be copied to /floppy. Though some windows managers for Linux have provisions for clicking on an icon to access a floppy drive. a CD-ROM drive and another partition of your hard disk (the Windows partition.Lesson 13 Mounting file systems In this part of the lesson about file systems we'll learn how to use the commands mount and umount We've mentioned previously that there's a different idea in Linux as to what constitutes a floppy disk drive. In Linux the floppy drive or other device must be "mounted". telling Linux that it is a file to be written to or copied from. To access a floppy disk from the command line of our shell.You now have a Linux formatted floppy. If you did it right. as if it were just another directory on our Linux system. Getting Started with Linux . you have a directory called floppy. If you want to mount a Windows floppy. for example. Some Linux distributions create this automatically during the installation process. you would type: cp my_file /floppy . we would use the command mount and type the following: (remember: you need to be working as 'root' to do this) mount -t ext2 /dev/fd0 /floppy Now this assumes a couple of things: • • • you have a floppy disk in the drive (you'd be surprised how many times I forget to actually put the floppy in the drive) in this example. typing the command 'df' (the command to see how much free disk space) should include something like this: /dev/fd0 1390 649 669 49% /floppy Your numbers may vary (especially if your floppy is blank!) Now. That means basically.
If it doesn't. A message will tell you that when you mount this type of device. Many people may have preferred to install Linux along with another operating system. For example. This doesn't effect your playing it. That's because Windows' file system doesn't distinguish file types. You may use the /mnt directory to mount the other devices (floppies. You won't be able to write to this type of CD-ROM drive. but for a more accurate accounting of what you have on your system. iso9660 is the standard file system for a CD. If you would like to access files on the Windows partition you would type the following command: mount -t vfat /dev/hda1 /mnt Windows is always in the primary partition.I have on occasion tried to copy a 3MB file to a 1MB floppy!) Mounting other devices You can also use the mount command to copy to and from other devices. The device (/dev/hdb) is the non-SCSI type of CD-ROM and the mount point (/cdrom) should exist. The directories are blue but the files are green (or red depending on your distribution of Linux). it would show up as a executable program and not just a standard file under Linux. just as you may have done with the /floppy directory. The choice for /mnt is the standard mount point in this case. You won't have the various color combinations as you do in Linux. the standard command to do this is: mount -t iso9660 /dev/hdb /cdrom The type. When you copy files from the Windows partition to the Linux partition you should bear this in mind. CDs) as well. if you wanted to copy an mp3 file from the Windows partition to the Linux partition to test out your sound configuration. you should create it in the root directory with 'mkdir'. Everything looks like it's a program (binary) instead of a regular file. You may have Linux and Windows installed in the same computer. We'll talk about file permissions and and making changes to them shortly. Getting Started with Linux . you would first change to the /floppy directory: cd /floppy Then you would use the mkdir command to create the directories you want. you may want to change the permissions of the file so that it shows up as a regular file in your color scheme.If you wanted to create individual subdirectories on the floppy. You can also use the command cp -r my_directory/ /floppy to copy the directory automatically to the floppy.Lesson 13 . Remember that the concept of CD-ROM is read only. so that's why we've used the device /hda1 (hard disk partition 1). If you change to the mount directory (cd /mnt) and then type: ls and you'll see something interesting. Mounting another partition of the hard disk. If you would like to get some files from a CD-ROM. I use the different empty directories (/floppy /cdrom /mnt) to avoid confusion. (make sure you have space! .
to you and to everybody.umount /mnt Remember also to NOT be accessing the floppy etc. when you use umount or it will give you a drive busy message. It took me a while to figure out that the command didn't include an N. it's important to know what belongs to me. Slim. I just wanted to point out another thing too. you may have left a terminal open where you were using to copy or write to the particular drive. you could do serious damage to your system if you didn't unmount manually after you were finished. I got the message: command not found. In the early days of Linux. This is basically because it was conceived as a networked system where different people would be using a variety of programs. There are security and privacy issues here as well. the mount points were: • • • floppy: /floppy . You are 'unmounting' but the command is umount (that is. U(n)deniably.unmounting file system Mounting file systems that aren't part of the standard Linux system is considered a temporary condition in Linux. As we mentioned at the beginning of this course. isn't good enough for me. Let's face it. Now that we know how to mount these outside file systems in Linux. etc. but I just thought it best to warn you. I may be the only person who has. the important thing now is to learn how to unmount it when we're finished using it. Well. I always take the time to unmount these external file systems when I'm finished with them. now you can use the standard devices that most PC users need.therefore umount /floppy CD: /cdrom .umount /cdrom Windows partition . we don't want Bill to read Bob's love letters to the Janet who works in R & D. Check your terminals if you get this error. Nowadays if you have mounted a system and you shut down the computer without unmounting. The command for this is: umount [/mount point] In the examples I used in this lesson. the big advantage that Linux has is its multi-user concept.the fact that many different people can use the same computer . maybe we'll save that last one for the super-advanced classes!) Getting Started with Linux . (because Janet is Bill's fiancée) In the end.Lesson 14 File permissions in Linux Linux has inherited from UNIX the concept of ownerships and permissions for files. We don't want an ordinary user using a program that could potentially trash the whole system. For all I know. I had done something wrong. Zip drives and matter/anti-matter flow inducers. CD writers.Umount command . the chances are pretty slim that you're going to trash a file system. I'd rather not take a chance. Obviously. there's a need to keep things organized and secure. however. If you get this. without the N of un) Being u(n)familiar with the mount concept when I started with Linux. (well. files. I typed unmount instead of umount and much to my surprise. I haven't really done a survey on how many people have actually done this. Later in our advanced class we'll talk about installing and using other devices like scanners.
• • • • The program name. This is a completely normal situation. are the permissions for the group. the people who use this computer). there are some differences. It belongs to bob in particular and it is one (1) file. the idea is the same as before. Root owns the file and it is in the group "root". We will show you how to understand file permission symbols and how to modify certain files so that they're more secure. We'll cover how to do that later.or that one person can use the same computer to do different jobs. for example. That's pretty logical. We'll save that for the Linux system administration course. In a one home computer environment anyone who uses the computer can read this file but cannot write to (modify) it. bytes are all standard. The dash . would have a d instead of a dash. you can do what you want with it. Let's look at the command for gzip. That's where the system of file permissions comes in to help out in what could be a very confusing situation. a file compression utility for Linux. The second part of the these symbols after the second dash. After the two dashes (two here because there is no write permissions for the group) come the overall user permissions. The changes are in the owner and group. This file can be executed by everybody: the owner (root). Anyone who might have access to the computer from inside or outside (in the case of a network) can read this file. as a user. We're going to explain some basic concepts about who owns the file and who can do what with a file. A directory. An interesting place to look at different kinds of file permissions is the /bin directory.e. Here we have the commands that anybody can use on the Linux system. The file is an executable (program) so that's why the letter x is among the symbols. Let's look at what these symbols mean: • • • • • • The dashes .txt 1892 Jul 10 18:30 This basically says. You. We won't get into an enormous amount of detail here. File permission symbols If you run the command ls -l in your home directory.separate the permissions into three types The first part refers to the owner's (bob's) permissions. Linux can establish different types of groups for file access. Once again. Let's take a look at some other examples. the group (root) and all others that have access to the computer . you will get a list of files that may include something like this -rw-r--r-1 bob users linux_course_notes. The rw that follows means that bob can read and write to (modify) his own file. interpreting this from RIGHT to LEFT that the file.txt was created at 6:30 PM on July 10 and is 1892 bytes large. -rwxr-xr-x 1 root root 53468 May 1 1999 gzip As we see here. If you own it. It belongs to the group users (i. Even though this is obviously different information. linux_course_notes.before the rw means that this is a normal file that contains any type of data. Then come the file permission symbols. Root is actually the only member of that group. may want to take away the rights of others to read your file. date. we can take away the possibility of people reading this file if we so choose.
o a=all.takes them away.• As we mentioned. chmod taketh away Your actual rights to files . they'll show up as such (-rwxr-xr-x). we can talk about changing certain permissions. (other people) o g=group. w=write rights (pardon the homophonic redundancy!) and x=executable rights Practical examples of chmod As we mentioned before. Now that we know what we're looking for. We also talked earlier about those files that you may have copied from a Windows partition or a floppy formatted for Windows. You can change them to their correct permissions. As we mentioned. We hope you enjoyed this little walk-through of file permissions in Linux. Getting Started with Linux . Best to keep those secret anyway.Lesson 14 'chmod' explained chmod is the program that is used to change file permissions on a Linux system. the permissions would look like this: -rwxr--r-1 root root 1065 Jan 14 1999 cron 'cron' is a program on Linux systems that allows programs to be run automatically at certain times and under certain conditions. If we look at a file in /sbin which are files that only root can use or execute. As we can see here. the owner of the file. Even if they're not executable files.txt Now nobody can read your plans to take over the world except you. so there is no w permissions for it for anybody but root.r=read rights. the members of your group o u=user. the file is a program. As we say in the Linux world chmod giveth. You can use this command to take away the possibility of others prying into your private stuff. You would simply type: chmod og-r my_world_domination_plan. is allowed to use this program. others cannot modify your personal user files but you may not want other people to even read these files. (this means you) The symbol + adds permissions and the symbol . so there is no need for anybody other than root to "write" to the file. you may want to restrict rights to read a file. only root. There are no x permissions for the rest of the users. The syntax (parts separated by brackets) for using this command is the following: chmod [a/o/g/u] [+ or -] (plus or minus sign) [r/w/x] Let's analyze the syntax: • • • The symbols in the first brackets refer to the four concepts of users that Linux has. getting rid of the executable status with: . all users o o=others.
You may want to change root ownership to yourself (your user name). Without going into tedious technical detail. 4 means read permissions for others. So the number 6 means read and write permissions for you. We've just given the group and others read permission. So if you use numbers with 'chmod'. read and write permissions for the owner but no write permissions for the group and for others. the method we described before will probably be clearer to you. we'll describe the chmod number system to you and look at two of the most common examples. When you're beginning with Linux.chmod a-x the_file Remember that if you copied them as 'root'. Here's what it would look like: User (or the owner) Group Others read-write-execute read-write-execute read-write-execute 4-2-1 4-2-1 4-2-1 It's really just a question of simple arithmetic. The three types of permissions correspond to three numbers. Just give it a 4 in each case. Some practical examples with numbers Let's take another look at my file that has my plans for dominating the world (my_world_domination_plan. Think of it as the most important permission. (chmod og-r my_world_domination_plan. Execute permission is given a value of 1. you will have to use chmod as root to do this. the number 4 means read permissions for the group and the last number. Using chmod with number values The permissions in Linux also can also be changed with number values. we've added the 4 for read permission and to the 2 for write permission for the owner to get 6. like the number 8 or 12 or even 1345? Let's explain this. You could even go one step further and change the ownership of the file to the user you desire. As I said before. (if you can't read a file. chmod 600 my_world_domination_plan. Now the question is: Why these numbers? Why not other numbers. We'll go into this in the next part of the lesson. we have three sections to permissions. Linux would have given you 644 permission by default. Read permission is given a value of 4. Presto! 644. That means.txt If you had used 'pico' to write up a grocery list for your trip to the supermarket today. so there's nothing to add in these two groups. An accomplished Linux/Unix user will probably use this system more.txt . One number corresponds to each group. Here's an example of a chmod command with numbers: chmod 644 grocery_list.letter method. then what else can you do with it?) Write permission is given a value of 2. I had taken away the read permissions for everybody except myself using +/. there will be three numbers following the command. those of the owner of the file followed by those of the group and then the permissions of others.txt) Now let's do the same with the numbers.txt.txt). In our example of chmod 644 grocery_list.
'fetchmail' won't run if you don't. It does not change the read. write and execution permissions however. The command is uses like this: chown owner:group the_file . We've got a possible security hole here. The different addresses are stored in a file that you create called '. though available to every user. you would then issue this command: chmod 755 my_awesome_script and the script would become "executable" (and readable) for the outside world. You have also converted yourself into a "web developer" with the right to hang your shingle on the door. (7 . Getting Started with Linux . It's a very good program if you're using your computer as different users for various jobs.fetchmailrc file. Real world examples with 'chmod' I'd like to talk about a real world practical example for doing this. 2 write 1 executable for you. When you create your . It is used for changing the ownership rights of a file (hence the name 'chown' . It's becoming more and more common to use scripts to improve the quality of a website's offerings. Let's look at another "real world" example.As you can see I have read and write permissions for me (4 read + 2 write equals 6) and 0 permissions for everybody else. we'll go into this command in more detail. chmod is one of those commands that are used most by system administrators. particularly if you're networked. There is a command mode program called 'fetchmail' for getting your e-mail.Lesson 14 Using 'chown' The command chown is the chmod's cousin. In fact. you would probably be given permission to use these scripts on your website. If you used a language like perl to write the scripts and you hosted your website with a company that runs Linux on their servers (we would hope that you would do this!). This command. In our Linux system administration course. After you uploaded a script to your website.change owner). you must then use chmod 600/chmod og-r on the file to solve the security issue. You could also use chmod og+rx my_awesome_script The script is then "converted" into a "program" so to speak. websites need to be more user friendly and interactive. As the internet becomes more popular. It will send mail to the different users based on e-mail addresses. You would then have to give the scripts read and execute permissions so that the your visitors could use them. In this lesson we've shown you just a few practical examples to get your feet wet with this very important command. 4 read and 1 executable for group and others).4 read.fetchmailrc' This file also includes the user name and password for retrieving mail from each address. This file shouldn't be read by everybody. is probably going to be used when you're working as root. It will complain about the file's permissions. The Zero value means 7 (maximum permission value) minus 4 minus 2 minus 1 equals 0.
Getting Started with Linux . This program assembles various files into one package. Linux is an "almost perfect" operating system.txt). So let's do it! chown bob:bob the_file This example presupposes that your Linux version creates groups for each user. There are others that will create a generic group called users for everybody who uses the computer. The best way to avoid problems is to backup your files. commonly called a "tarball".txt and you've placed them in a directory called /linux_course. computers aren't perfect. as root.Let's say you want to copy something from your Windows partition (if you have one). Then you have the options. root is the owner of the file. the name of the program. On a network. Therefore. If you plan on working with the file as "bob". you have tar. you copy the file to your user directory /home/bob/. You would type the following command to package them in a tarball. As you can see. Let's say you have some files . You want to back them up and keep them on a floppy. Linux provides two key programs to do this: 'tar' and 'gzip' First we'll start with 'tar'.Lesson 15 Backing up your files Let's face it.*. a CD writer or a tape backup drive). c (--create) v (--verbose-show what files they are) (f--file -make a file .txt notes_3. If you want to include ALL files in a directory. If you type ls -l the_file you'll get something like this: -rw-r--r-1 root root 2428 Nov 17 13:18 the_file As we now know from the previous lesson. tar -cvf linux_notes.txt notes_4. You have: • • • • • notes_1. just type ls -l and see what system corresponds to you. groups are created according to the needs of the organization.tar) and the files you want to backup (notes*.txt notes_5.txt notes_2. This presupposes that you may have other files in the directory that you don't want to include. let's say.should always be the last option) Then you have the name of the file you want to create ( linux_notes. you might want to back up whole directories along with their .txt First.txt for *. You mount the partition (as root) and to save time.notes that you've taken during this course.tar notes*. there isn't a snowball's chance in hell to modify that file until. but things do happen and data is sometimes lost. you run chown on the file. 'chown' is absolutely necessary if you're working as more than one user with the computer. If you've got good data storage capabilities (Jaz or Zip drives. just substitute notes*. On your single home computer. root is the only one who has write permissions for the file (permission to modify its content).
gz extension. untar it in a different directory. let's say /home/bob/ and issue the command: tar -cvf bob_backup. Then you would enter in the directory.txt).tar and the tar file would be compressed.Lesson 15 Untarring and unzipping files Using 'tar' and 'gzip' sort of supposes that you're going to want to "untar" and "unzip" these files at one point or another. then you should make a new tarball. The result would be a file like this: your_tar_file.gz The two file extensions show us that the file is a tarball and it is compressed with the 'gzip' format. . This is the first step in the backup process.tar. Putting it all together 'tar' has an option built into it to use 'gzip' to zip the file at the same time you make the tarball.corresponding subdirectories. you will include directories and files without extensions (my_file as opposed to my_file.gz * Remember f should always be the last option. you would issue the following command: gzip your_tar_file. Our previous example would be modified to this: tar -czvf bob_backup. The easiest way for doing this is to use 'tar' for the whole process. you have the whole shebang in one step. There is no reduction in the size of these files (the tarball might even be bigger!) Now we would have to do one more thing in order to reduce this file into a more manageable size: use 'gzip'. You can now proceed to store this as you see fit. Now let's look at the second step.tar. and change the name of the file to create to a . If you untarred it in the same directory. If you don't want the old files. If you would like a copy of the old file. the compression of these files. Be prepared to get a fairly voluminous tarball. you'd overwrite the existing ones. You can also compress a regular file using the same command. gzip is the preferred compression tool for Linux. You would locate the zipped tarball in question and then ask yourself a question: Did I make any changes to the files inside the tarball after I made it? If you did. If you add z to the options.tar * With one asterisk. 'tar' just assembles the files together into only one file. then you've got an old tarball. Using 'gzip' As we mentioned. It's pretty standard backup practice. To reduce the size of your tar file. Getting Started with Linux . but gzip is used primarily with tarballs.
As a matter of fact. When you compile a kernel (create a custom kernel for yourself from source) there is an option to create a bzipped kernel. Just leave the z option out of the previous example and type: gzip -d my_tar_file. bzip2 There is also another tool that is rapidly gaining acceptance in the Linux world: bzip2.tar. Other compression tools zip Most Linux distributions come with other tools to compress files.gz).Lesson 16 Installing New Programs The way you install a new program will depend primarily on two things: 1.preserves dates. to proceed with the "untarring".When you've decided what you want to do. tar just sort of sits around doing nothing) The files are extracted and your original tarball is preserved (my_tar_file.use the file in question (if you don't specify this.gz (gunzip runs gzip -d "automagically"!) These commands are good if you've just zipped a regular file (not a tarball). If you're planning on compressing files to give to someone who (still) uses the Windows operating system.gz or gunzip my_tar_file.tar. What is the origin of the program that you want to install? Let's look at the first question: What distribution are you using? .e tar tells you what files it's extracting) -p ."verbose" (i. permissions of the original files -f . This is supposed to become the official way of doing it in the near future. The compression factor is supposed to be a little better. You can also untar the file and then use gzip separately. There are some differences in options for more advanced users.unzip the file first -x . the Linux kernel source package.tar. issue this command: tar -zxvpf my_tar_file.gz I've used my preferred options. You can also use unzip if someone gives you a file compressed with 'zip'. Consult man bzip2 for more information. usually comes "bzipped". so it may be a good idea to get to know 'bzip2' For all practical purposes you would use this tool in the same way as you would 'gzip'. famous in the MS-DOS/Windows world.extract the files from the tarball -v . What distribution (version) of Linux are you using? 2. One of these is zip. Getting Started with Linux . I'll explain them: • • • • • -z .tar. Consult the man file ( man zip) for specific instructions on using this tool. this might be your best bet.
One is to "uninstall" the older package and install a new one in its place. for the most part. That is. Then you would type rpm -i opera_beta8. This system takes the heartache out of installing programs under Linux. this is not the most efficient way to update packages. you will see: package opera is not installed If you don't have Opera installed.rpm and that would install the new version and remove the old version from your system. Not that this is the most efficient option. then you're going to use the RPM method. Let's say you hear there's a new version of the popular Internet browser Opera for Linux and you don't know if your Red Hat based distribution installs this by default or not.rpm This installs the program (-i option for install) rpm -q program_name This "queries" your system to see if you've got a certain program installed. it would give you the version number: opera-5. You would type: rpm -U opera_new_version. For example. then you would first do: rpm -e opera. there are some very good tools for installing. You can choose menu options to do all that we explained before instead of having to type the commands in the terminal. It stands for Red Hat Package Manager. Before you download the RPM for Opera. There are some basic commands you're going to need to know to take advantage of the RPM system.0_whatever-number If you don't have the package installed. If you do have the program installed and the rpm -q opera command gives you a older version number and you want the newerone. The usual way is to use the -U (as in Update command. You may want to look into programs like Kpackage for .RPM doesn't have anything to do with revolutions per minute. I just wanted to introduce you to the -e option for RPM. rpm -i new_program. If you do have the package installed. As I said. if you've got Opera's beta version 7 and you've just downloaded the beta version 8. you would type rpm -e program_name. I also want to note that RPM has also come to mean the package itself (as in "I downloaded an RPM yesterday").rpm as root and install the program. to get rid of a program that you've installed. OK racing fans. That installs the new version. then you can download their RPM and run rpm -i opera_whatever_version. Those are the basic commands of the RPM install/update system in a nutshell. Developers will almost always offer their programs in RPM format due to its popularity. you could type the command: rpm -q opera. updating and uninstalling RPMs that are graphically based. then you have two options. You can go to the Red Hat website or any number of mirrors and get programs for Linux. This gets rid of Opera from your system.RPM If you're using Red Hat or a distribution that bases itself on Red Hat. When you're using your windows manager.rpm (or whatever the package is actually called).
I suggest that newcomers to the Linux world buy (yes. Then you would type: dpkg -i package. You can theoretically get a distribution from the Internet along with programs and install it for free. Many websites out there offer RPMs for download. dpkg This is the "classic" way of updating a Debian system. Time might be even more valuable than money. That means if you're using SuSE or Mandrake your best bet is to go to their respective "official" websites or mirrors and download their particular RPM and install it using the procedure outlined above or their specific tools. you could go to Debian's website or any one of its mirrors and download a package.KDE or Gnome RPM for the GNOME enviroment. Now let's look at installing programs with Debian. . like the Opera web browser in mentioned above. I said buy) a good boxed set of a commercial distribution and then they'll have more programs than they would ever need.deb) package format and successfully installed it in a computer running Debian. Getting Started with Linux . I have successfully installed this package (the same exact RPM file) on SuSE. You may run into a problem if you installed an RPM for Red Hat on a SuSE system. (lost money might be re-earned but not lost time).deb to install it. The good ones usually include a list on that particular RPM's page of other programs or libraries that you need in order successfully install and use the program. no money down). That's fine. Some words of caution on downloading RPMs Some of the most popular Linux distributions base their install and update prodedures on Red Hat's package management system. They may make these tasks a lot easier. I like to classify them according to your connection type. The big buzz word with Linux is "free". especially if you're just starting out in the Linux world. I think. These include Mandrake and SuSE for example. I even converted this RPM to Debian (. should install fine on any RPM based system. that time is money. (ie. Mandrake and Red Hat. When I first installed Linux oh so many years ago. to use the trite expression. If you see a list a mile long of "requirements" (those other programs and libraries you need). And here's just an editorial comment on my part about this type of thing as well. all installed and working properly along with a manual to tell you what to do in case something doesn't work. Typically. More on this conversion later in the show! Just a brief second word of caution. then you might want to ask yourself if you really want to try that program out. updating and installing stuff was at times a frustrating experience. however. Getting and RPM doesn't necessarily mean that you're automatically (or "auto-magically") going to be able to install it. Both of these companies create their own RPMs to be specifically installed on their systems.Lesson 16 Debian Updates There are various methods to installing new programs on a Debian system. Third party RPMs from reputable companies. Certain components in the package (like documentation or libraries) may get copied into a different directory than was intended for that system.
This number is larger just before a new major release.typically. Then you start the process by choosing the install option. but not actually do it) with a = sign. it seems to me.The main drawback to this is that you may find a package that you like but it may have dependencies (ie. one that is for "experienced" Linux users only. many people prefer to use automated programs. other programs that it needs to make it run) and if you don't have those packages. Despite what they say.Lesson 16 Installing new programs on Slackware Slackware. I would choose FTP Then you would choose the packages you want with a + sign. Let's talk about this method of installing new programs with Debian. then the install will fail. how you're going to get and install them. has the reputation of being. T1. That means. But if I were updating. though) to guide you through the install of new programs. the main advantage of dpkg. If that's the case. This is what the Debian people themselves have to say about this method: Many people find this approach much too time-consuming. A lot of these considerations are "politically" motivated. then I would choose CD-ROM. if I were doing an install of Debian with CDs. First you'll get asked for your preferred access method. Then you're on your way. To deal with this avalanche. xDSL. For example. As I said before. Slackware lacks some of the "smooth" and "slick" graphic installation packages that are becoming standard fare in . it seems that a slow and sometimes expensive dial-up connection would be less than ideal for this. is that it is easy for people who have dial-up connections. which are dselect and apt-get are better for permanent connections (cable. Debian will then configure the installed packages. automated programs they're talking about. There may even be conflicts or dependency problems and 'dselect' will warn you about those. The Debian people point out that this is ideal for installs or large-scale upgrades. the main advantage to this is that any conflicts or dependency problems will be resolved right here. T3). You can even put updates on hold (indicate that you want to update. on one hand. known to the Linux world as "Slack". In the next section we'll look at installing programs under Slackware Getting Started with Linux . on the other hand. dselect When you use dselect you get a graphic user interface of sorts (not under X window. This is because the alternative. a flexible distribution that allows you to do practically anything you want and. a dozen or more new packages are uploaded every week. since Debian evolves so quickly -.
I would say that word processing is probably the computer activity which is . That's a good option for the "I wonder if I want this" moments of your life.commercial companies' offerings but in the end. GUI does not necessarily = GOOD Once again. A computer running Slackware is a tremendously flexible and configurable system.rpm and convert it. The way to do this is: rpm2tgz some_package. You can go to your favorite website and download new programs for your Slackware system and with a simple: installpkg some_program.tgz format.tar.tgz format. you can also grab on to an *.tgz you have your new program installed.gz format we've seen before. it will tell you what new files are going to get added to your hard disk. Don't let that missing GUI fool you here.tgz format. you can just remove it: removepkg some_program. Slackware's package format Slackware packages come in *.tgz You can also add the option -warn between the installpkg/removepkg command and instead of installing the package. it is somehow inferior. So what if you have to write things on a command line? That's what you've got a keyboard for. there is a common misconception that just because something doesn't have a wonderful graphic interface that makes you say "oooh" and "ahhhh". Upgrading packages You can upgrade programs to newer versions with this command: upgradepkg a_new_version_of_something.tgz Using other package formats If you're using Slackware and you can't find a package your looking for in the *.Lesson 17 Printing under Linux Although this is my personal opinion and I have not done scientific research on this topic. This a variation of the *. If that particular package doesn't quite move you and inspire you too much. if you're willing to just use the command line utilities. it's just as easily updated as any other major distribution. Then you can use installpkg on the new file you've created to install it.rpm This takes the "rpm" in question and converts it to *. isn't it? Enjoy your "Slack" system! Getting Started with Linux .
generally. really). . then getting your printer up and running under Linux is going to be a priority. What you're doing when you print under Linux Historically. Mandrake has its printer setup tool in its main configuration package. if you downloaded a report from the Save the Whales Foundation on the mating habits of the pilot whale in PDF format and you wanted to print it. it seems that we handle more paper not less of it in our networked world. As I mentioned. The lpr works with the lpd or "line printer daemon" running on your system. Install a printer Most Linux distributions come with tools that will get you printing in no time. logically. The basic means of printing in Linux just takes off from there. it was just important that they used them. (resulting in rather plain looking text on paper with holes on each side some of you might remember this). As I mentioned before that Linux's printing system is based on basic line printing. graphics and other visual goodies can be found in standard printed material that comes from a computer. After all. Today's computing needs in terms of printing are much more demanding. printing used to consist of just sending rather boring looking output to a line printer. Debian and Slackware both use the 'apsfilter' tool as well. . Linux has changed a great deal and hardware manufacturers got the idea quick that it didn't matter what OS people used their printers with. All mainstream Linux distributions come with Ghostscript. means printing them afterwards. you'll need a working "printcap" file (to be found in /etc/printcap. OK.because computers work pretty fast. you should push the "print" option in the menu. Writing things. without your direct intervention. you'll need some filters installed that know how to print PDF files. But how do we get from the point where you've got Linux installed to where you can print something with your word processor? Here are the steps. Red Hat comes with "printtool". When you first set up your Linux machine to use a printer. to use a hackneyed expression. many people curl up in bed with a novel or a report for work. That means that all of the major distributions offer first rate tools to get practically any printer running under Linux. usually) that tells your system what printer it's supposed to work with. I don't see that custom being altered unless someone comes up with a comfortable way to use a computer in bed! Obviously.maybe a couple of seconds . These filters are used to make sure that "What you see is what you get". How to print If you want to print. A "daemon" is just a program that works in the background. Luckily. Your Linux machine should be capable of printing anything you want as long as you have the correct filters. The fact is that people open up their word processor of choice (or the one they're forced to use at work) and write things on a pretty regular basis. if writing/word processing is so important and printing is the logical next step after writing. The queue (queue the British word for what Americans call a "waiting line") just puts your print job on hold until the system figures out the way to print it. This is a free implementation of Adobe's Postscript filters.done with the most frequency. For example. printing in the Unix platforms started off as just sending plain text to a line printer. Exotic fonts. E-mail may be surpassing the popularity of basic word processing (e-mail is just an extension of that. which it will then send to the lpq or "line printer queue". This holding pattern is usually pretty quick . you'll be configuring the lpr or "line printer". With SuSE you can use YAST to create this file (which will invoke a program called 'apsfilter'. 1. you know that already. This daemon just waits there for printing jobs to be sent to it. Despite what we're hearing about the web doing away with the printed material as we know it.
upp--raw-printer1:\ :la@:mx#0:\ :tr=:cl:sh: 2.upp--asciiprinter1:\ :la@:mx#0:\ :tr=:cl:sh: # printer1|lp2|y2prn_printer1. I have forgotten to do this (which ironically seems to happen with much more frequency as I get familiar with compiling kernels) only to find that I can't print anything when I've finished installing my new kernel.upp ascii:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/y2prn_printer1. the /etc/printcap file that SuSE configured for my main machine at home is this: printer1-ascii|lp1|y2prn_printer1. This will take care of your more advanced formatting needs. I have also noticed my system choke on stuff sent to it from Corel WordPerfect.upp--raw-printer1:\ :lf=/var/spool/lpd/y2prn_printer1.upp--ascii-printer1:\ :lf=/var/spool/lpd/y2prn_printer1. I won't go into the "hows" and "whys" (because I honestly don't know why or how this happens) but I have fell victim to an inability to print from WordPerfect on occasion. When you get up to speed on Linux and you decided to do this.upp--ascii-printer1/acct:\ :if=/var/lib/apsfilter/bin/y2prn_printer1. you'll have to consult the documentation in your case. so that's why I included this last part.upp--auto-printer1/log:\ :af=/var/spool/lpd/y2prn_printer1.upp auto:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/y2prn_printer1. For example. . Printing therefore shouldn't be a problem. most people at some stage of the game prefer to compile and install their own custom Linux kernel. Install the Ghostscript package and other useful filters Most major distributions always recommend the Ghostscript package by default. like the jpeg libraries and other image formatting libraries are also installed by default so you can print your image files easily and painlessly.upp--auto-printer1:\ :lf=/var/spool/lpd/y2prn_printer1.upp--raw-printer1/log:\ :af=/var/spool/lpd/y2prn_printer1. Some useful trouble shooting techniques Most printers work from a parallel port. 3.upp--raw-printer1|y2prn_printer1.upp--auto-printer1:\ :la@:mx#0:\ :tr=:cl:sh: # printer1-raw|lp3|y2prn_printer1.This lesson is not meant by any means to be the definitive list on products from every vendor.upp--ascii-printer1| y2prn_printer1. so if your particular distribution isn't listed here. Other ones. You must have parallel port support enabled in your kernel. Most major Linux distributions will install a generic kernel with this enabled.upp--auto-printer1/acct:\ :if=/var/lib/apsfilter/bin/y2prn_printer1. Turn on the printer and press the print button I sometimes forget to turn on the printer. always remember to include parallel port support into your new kernel.upp--auto-printer1|y2prn_printer1. so it goes on your system with a standard install.upp--ascii-printer1/log:\ :af=/var/spool/lpd/y2prn_printer1.upp--raw-printer1/acct:\ :if=/var/lib/apsfilter/bin/y2prn_printer1.upp raw:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/y2prn_printer1. However.
including this page. Your modem or other device that connects you is like the engine of your car. Your computer is like that car on the highway. Types of connections There are basically three types of connections to the Internet. If you have been using Windows. my debut in the karaoke bar will have to wait. if you have a problem (like my printer being unplugged. In fact. like jet fuel.What I usually do is see if in fact I have pressed the button 'print' and something is waiting to be printed. shut WordPerfect down and start it up again and try printing again (which usually works for me). To see if you have something waiting in the printer queue. Output generally looks something like this. switches and satellites that bring the hundreds of millions of pages of content to you. waiting for printer1 to become ready (offline ?) Rank Owner Job Files 1st bob 46 grocery_list. The superhighway itself is the telephone companies infrastructure .Lesson 17 Using Linux to access the Internet We live in an interconnected world. but I can still do the shopping. that's like using gasoline. in this case). . Linux and other OSes are a bit like the fuel you put in your car. you're not going anywhere. but you'll go faster in the end. After this lesson. if I wanted to just get rid of these files. On-ramps to the "information superhighway" I think that the term "information superhighway" is a perfect analogy for the Internet. however. If you can't get the engine to work. just issue the command: lpq This will show you what's in the printer queue or if there is in fact anything there. Chances are. That's probably why it has become so popular.txt 2nd bob 47 lyrics_to_sinatra_my_way. You'll have to modify your engine to be able to use it. Hopefully you won't need to use these troubleshooting techniques very often. I could also be selective about it and only delete one of the print jobs by typing the command: lprm 47 Alas. leased lines. broadband and dial-up connections. you're using this interconnectivity in form of the Internet to access this course. If you switch to Linux. I would just issue the command: lprm Which removes the whole line printer queue. you should be able to connect and browse what's out there in cyberspace using Linux.txt Total Size 667 bytes 2323 bytes For example. but they're good to know just in case.the lines. fiber-optic cables. That's why we've written this lesson. that's different. Enjoy printing under Linux! Getting Started with Linux . that you're using some other OS to connect to your ISP and read this course.
tells the ISP who you are) using a couple of established network protocols. at least in my area. about 5 times slower than the slowest broadband connection. Let's move on to the next section where we'll show you how to set up the different Internet connection alternatives under Linux. but broadband is the best alternative for home users. it was the only way to get on the Internet.a footnote: A few years ago. In the xDSL area. ISDN . This connection type basically consists of using a modem to dial the phone and connect to the Internet Service Provider (ISP). xDSL (Digital Subscriber Line) and cable modem are what is known as "broadband" connections. For example. there may be. using the tactic of car advertisements that say from 9. and I suspect there are legitimate technical reasons why a cable connection is essentially cheaper and easier to provide to to consumers. This depends a lot on where you're connecting to and other factors. Getting Started with Linux . It's a little out of the scope of your average Linux user. Up until the late-1990's. The modem "negotiates" the connection (ie . I can download a 5 megabyte file (like a song) in about 3-4 minutes. particularly in the United States because the cable companies seem to have gotten on the ball faster to offer consumers high speed connections. My connection runs at 250 kilobits per second when I am receiving data. I went through the process of . The few people who I know who had this service (and later dropped it) complained about the speed. These services offer 24 hour high-speed connections to the Internet in most cases (unless you shut off your machine. nobody seems to be talking about it so much anymore. This course will not deal with setting up and Internet connection with these lines. of course). in my area at least. With all due respect to telephone companies. if you weren't a Fortune 500 company. I have ADSL service. Lately. Dial-up (standard modem) connections are by far the most popular way of connecting to the Internet. cable modem is becoming more popular than xDSL. you can even opt for higher speeds (up to 2 megabits per second) and have Internet service that rivals much more expensive leased line alternatives. (and I'm not a telecom engineer) so suffice it to say that cable seems to be the way people are going to get high speed connections to the Internet. This has never seemed to have caught on. namely the slow modem speed and the fact that you couldn't make or receive phone calls while using the Internet. you can even use this connection to serve your own personal or small business webpage using Linux as a web server. just couldn't be delivered. but in reverse). At any rate. These are known as T1 and T3 lines in North America and E class lines in Europe. depending on your relationship with your local telecom company) the telephone company handles most of the heavy lifting during the process of getting Linux to work with an ADSL connection. in my area. the telephone company was trying to sell people on ISDN (Integrated Services Digital Network) to solve the two main problems with Internet use. Depending on what company is providing you with this service.Leased lines are high-speed connections that ISPs use to connect you to the rest of the Internet or big companies use to communicate between parts of their organization and to allow you to connect to them.Lesson 17 ADSL with Linux Fortunately (or unfortunately. The best speed you can hope to get out of a dial-up connection is 56 kilobits per second. What they promised. That is to say. They promised connections of up to 128 kilobits per second (the key words here being up to. The reasons behind this would go beyond the scope of this lesson.599 dollars. To put it in other terms.
you should get an Ethernet hub to distribute the connection between PCs. For example. even if you've never looked under the hood of your PC you can muster up your courage and install this card yourself. This is pretty important.switching from standard dial-up not too long ago. Sometimes they will offer you Internet service and at the same time arrange for the telephone company to come over and install a splitter which allows you to use the same phone line for data and voice transmission. I encourage people to do it for themselves. The basic reason for this is that it is usually platform independent which means that it doesn't matter what OS you're using because you can probably configure it using Telnet (in my case) or even a web browser. which I have also seen done. This is a great option for a small business because a router allows you to painlessly share the connection between multiple computers. I have even heard of the telecom people doing this for you. In the best case scenario. via router and via modem. Plus. Here are some of the things I had to do. you may have to accept the hardware they recommend (or force on you). you connect the router to the Ethernet card so your PC can receive the data. Putting in all together A picture speaks a thousand words. even selling your their own hardware in the process. (graphics courtesy of The GIMP It's really too good of a program for my poor artistic skills!) . What that's in. My card of choice (because it was the only one they sold in my area) is the NE-2000 clones. It is also important that you know if you accept their services. Get an Ethernet card If you go the router route (pardon the pun). It's a question of using a small screwdriver. Choose a router or modem If a modem isn't forced upon you. ask if you can use your own choice of hardware and then hope they say yes. This is a good one because most major distributions will detect this (they always have for me) during a standard install of Linux. These cards are designed to allow you to connect computers in a Local Area Network (LAN). This is very important for security because you're going to be connected 24 hours a day. you're going to need an Ethernet card. You can also call your local guru. I chose a router that had capabilities for filtering out unwanted incoming connections. in my case. then it's a good idea to choose the router option. They may pretty much obligate you to use one or the other. so the process is fresh in my mind. There are two main connection options. 2. 3. Realtek 8029 PCI is the one I use in my machines in my home office. so I made a little drawing of my home network to demonstrate what a possible set up might look like. For the faint-hearted. 1. If you've got more than one PC in the house. Call the ISP.
0. That is to say.20.2.org. when you go to www. they might conflict with numbers that are actually out there on the Internet. If you used any other numbers. In case you didn't know.20.168.1 . The numbers 192.X are reserved for private networks.3. if someone announces that "e. these numbers start with 192. and then have two numbers after these.168. This number has to be unique. when the telecom people came to hook me up. In my home. I was given a unique number.168. Now. If there are 20 members and 7 of them are named Bob then. 192. like Linux. One Ethernet cable (green) goes from the router to the hub. Then I used Telnet to access the router. The router was equipped with the possibility of using a a program on a CD to configure the Internet connection if I was using Microsoft Windows or Telnet for another OS. you don't identify yourself to other computers with 192. when you use the Internet.1. so each PC is assigned an IP address which is a number that computers identify themselves with. I assigned my PCs the numbers 192.1. In my case.1 to the router. to get on the highway My home network is a private local area network. One is for the phone and one goes to my router.X.1.168. so as soon as I turned it on. I took out my router and connected it to the data line coming from the splitter (see the picture). you're actually going to a computer that is assigned a number on the Internet. the manufacturer of the router in the factory assigned the number 192. 192.1. It's a lot like running a men's bowling team.X. Now. let's say it was 20.linux.168.1.Two cables (red) come from the splitter. Other Ethernet cables (blue) go from the hub to the PCs.168. you could say for all intents and purposes that I had another computer on my local network with the address of 192. so you will have to use these.Bob has the highest score" then there's going to be confusion.4 respectively. 192. With ADSL you are assigned a unique number with which to connect to other computers. In my case.X. Then I hooked up the router to the hub and then one of my PCs to the hub.168.168. I opened a terminal in my PC and typed: telnet then: open 192. I had to know what address my telecom company had assigned to me for Internet purposes.0.0.0. Before I used Telnet to access this router.168.20.168.
It's just an example I used to correspond to the numbers that could be given to you by your telecom company.5.168.conf you'll have to add two lines to /etc/sysconfig/network .conf file.0.linux.conf and /etc/resolv. I run SuSE Linux on this machine.30 nameserver 40. so I logically started with that one.0. First.0. When I was configuring the last computer. Without these numbers. I assigned the router the unique Internet numbered address my telecom had given me and then I changed the address of the actual router to 192.168.40 These are not the actual numbers I was given. These are the primary and secondary DNS numbers. I was on line with all machines going out through the router. in /etc/route.30. I learned this fact in my haste to get the rest of the network set up. They also furnished me with a default password which I used to connect to the router. so I had to change 2 files: /etc/route.let's be careful out there After doing all this. Now.0.168. I saved the changes and exited. Then I added two lines to my /etc/resolv. The changes I had to make took all of 30 seconds.conf. This is important because you are a sitting duck for intruders with ADSL.0. Once in. That is to say. I had to write the line: default 192.org is actually a number out there and they help you find it.conf. 0. nameserver 30.0. it really isn't as far as a target for hard-core hackers/crackers) but there are a lot of mischievous people with time on their hands that go around looking for trouble. The final step was to tell the PCs where to get their Internet connection from. you wouldn't stand a snowball's chance in hell of finding anything on the Internet.conf file. These are the lines I added: GATEWAY=192.5 is the default "gateway" to the Internet.0 is the subnet mask (not important for our discussion here) and eth0 stands for your Ethernet card that you installed and is connected to the hub which is connected to the router. at least. When I fired up my browser. I had ADSL service coming in to the router. You're on line . These people use tools they get off the Internet to scan numbers at random to see if the machine attached to the number can be "hacked". You may not think that your local home network might be important compared to some corporate website (which. A domain name server is just a machine that has an inventory of other computers on the Internet.5 0. popularly known as "Script Kiddies" seldom know .40. Most of these people.conf are the same.0 eth0 Which means that 192.0. I forgot to change /etc/resolv.which was the local numbered address the router came with by default.0. it basically did nothing until I remembered to change that file. DNS stands for Domain Name Server.168. to me more in synch with my local network's numbering scheme and then I changed the password to access the router.5 GATEWAYDEV=eth0 The changes to /etc/resolv. I was using my workstation to configure the router. I quickly disconnected the hub to all but one machine and following the instructions. I had a text mode menu (the best you can do with Telnet) and going by the router's manual plus my local telecom's instructions. instead of /etc/route. or where the machine is going to route out of to get to the outside. these computers know that www. If you're using Mandrake or Red Hat. and set up some necessary security.30.40.
For example. The subject of firewalls goes way beyond the scope of this beginner's course and I don't pretend to explain how to set up a firewall here. webservers run on port 80. A lot of these people are script kiddies who like to get in feuds with people on channels. But there are a few people with dubious social skills who are just on IRC to be jerks. you are somewhat vulnerable to these socially unacceptable characters and what they may try to do with you. Telnet.or point of entry to computers from the outside.2 at the time of this writing) enables SSH by default. people could just connect to it and see what they wanted. I suggest you read Bob Toxen's Real World Linux Security: Intrusion . Packets are the data that comes in and out of your computer when you're connected to a network. Apache's webserver is pretty safe. they don't have to know how the program works. There are a couple of things that you can do without having to be a guru on security to help secure your Linux box. Report them to their ISP or the local authorities if they threaten to do harm to your machine. As they say. IRC chat is a good place to chat with friends and also a good place to inadvertently invite people to take a swipe at your machine. The passwords you send to connect via Telnet.a way to connect to a remote computer. A brief explanation of ports I was lucky in that my router has the ability to filter packets built into it. only what it does. how do you say. like the Internet.how the software works and really don't care. I always think of Goldfinger's comment in the James Bond movie of the same name when he explains his plan to steal the gold from Fort Knox to a bunch of incredulous Mafiosos. Some big corporations pay people big money to set up firewalls in their organizations and then they get hacked anyway. 7. That's a pretty safe port. a little knowledge is a dangerous thing. Security with ADSL Security in Linux is way out of the scope of this beginners' course on Linux. Actually. They just know they can do harm with it. it isn't the port itself that should be considered safe or unsafe. The WWW wouldn't function if it didn't. It has to be. for example runs on port 23. seek technical help and even work and collaborate on projects at a distance. Report any threats to the channel operators. The people who designed the big network of networks came up with the concept of ports .'knocked off'" If you want a good guide to providing security for your PC running Linux. I also have FTP disabled. Seeing as IRC can tell a lot about where you are. Microsoft's webserver IIS isn't. It would be like a house made of glass. their computer makes a request to port 80 on the server to send them the page. But. That makes it almost impossible for someone who you don't want to to connect and try to do harm to your computer from the outside. People would spend the day throwing stones at it. Any decent network that's connected to the Internet has a firewall.(port 21). Telnet is a 'shell' . 007's red-headed nemesis says: "It is a bank like any other and banks can be. SSH runs on port 22. I substituted it with SSH or Secure Shell. Firewalls A firewall is just a barrier between a network that's inside a home or company and the outside world. Most people on IRC are there to socialize. I also disabled my computer's ability to accept connection via Telnet. it's the software running behind it. Remember. If your private network didn't have a firewall. SuSE Linux's most recent offering. That's a port that I told the router not to accept connections to. (v. SSH accepts remote connections that are encrypted or coded. as we have seen with the famous CodeRed worm. If a user on a network wants to access a web page on a server. even though you may see little asterisks (or nothing) can be picked up easily by people who 'sniff' these passwords. Sometimes the person's ISP figures in the information on IRC.
is to discuss the way to get a dial-up connection running under Linux. please read some books or seek a professional security consultant's help. Detection and Recovery. There's no reason not to let people locally to log in via the SSH program that we mentioned before. Nevertheless. This is OK as long as you trust them. Microsoft Windows . in /etc/hosts. Until recently it was impossible to get one of these little jewels in the MS crown running under Linux.allow First. was based on the configuration of the hardware. This will allow local users to access the computer. you could check out Linmodems.168. Practical protection for the beginner A good way to protect your Linux machine. There are all kinds of stories about disgruntled employees taking liberties. There are modems and then there are "winmodems" Once upon a time. when you don't know too much (yet) about security is by making the following very simple changes in two files: /etc/hosts.Lesson 17 Dial-up connections with Linux Despite the increasing popularity of broadband Internet access and cable company's ventures into the Internet business and their offering of connections. Then. the best selling book on security from a Linux perspective. at the time of this writing. you guessed it. If you happen to have one.deny and /etc/hosts. Getting Started with Linux . etc. there were modems (which still exist) where the ability to use it to connect to computer networks. extended vacations with company money. therefore. like the Internet. If you are setting this up on a small business network.Prevention. usually at speeds ranging from 14.0. the vast majority of people in the world. yes. They became known as "winmodems".allow ALL : 192. I would be a bit more careful. If you are a home user you're probably safe but if you are using this to set up a small business network. companies like Motorola.org for more information about installing drivers for .deny add the following line: ALL : ALL This is meant to block (1st ALL) services that your computer provides from anybody (2nd ALL) that may try to log in to your machine. if you have more than one computer (a small business or home network) you should add this line in /etc/hosts. One last word: This ISN'T a substitute for a firewall or a serious security set up. The purpose of this lesson.4 to 56 kilobits per second (kbps). This software was exclusively compatible with. revenge. Rockwell and others developed modems where the configuration of the device was made possible through software more than the embedded programming on the hardware. connect to the Internet via telephone dial-up through the use of a standard modem.
as I mentioned. You'll see the various "com" ports available and even. however.net. we usually start counting at zero). then you should have no problem setting it up with one of their utilities known as modemtool. Not surprisingly that it is called eznet. you might want to go to Dr. Mandrake and Slackware was trivial. Before that I used a 38. Red Hat. The trick (really not a trick because there is no difficulty involved) is to alter your Linux configuration so that it knows that you've got an external modem on /dev/ttyS1 so it can communicate with it. where I am writing this lesson. Now that you've got a modem connected. If you've installed Mandrake. Linux knows com1 and com2 as /dev/ttyS0 and /dev/ttyS1 respectively (in the computer world.8 kbps internal modem and a 28. upgrading as the higher speeds became available and their decreasing prices warranted the change. known as "com1" and "com2". we'll talk about configuring your connection with your ISP in the next part of the lesson. As 'root' you would fire up their configuration tool called YAST and choose the option 'System Administration' and then the option 'Integrate Hardware into System'. with the newer version of SuSE. It was written by Richard Hipp and it makes setting up your Internet connection absolutely trivial. files that reside within the /dev/ directory. For Red Hat and RPM based distributions there is a RPM package compiled by Kent Robotti and available through RPMfind. A serial port is similar in appearance to the one that is used to connect your mouse. I have had (and heard of) mixed results with this tool.Lesson 17 Getting in touch with your ISP There are a lot of tools out there to assist you in establishing a connection with your ISP so you can get out there on the Internet. be sure to choose com2 or /dev/ttyS1. If you have a serial mouse. there are two serial ports. their tool HardDrake should do the trick. Linux always knows these devices by other names. which. A parallel port is one that is normally used to connect a printer. Linux knows as /dev/ttyS1. For example. of maintaining a dial-up connection is using an external modem or an internal modem where the hardware primarily is designed to handle the connection. External Modems External modems are called that precisely because you have a little box that sits outside your computer. this is usually occupying com1 and therefore /dev/ttyS0. . Before I had an ADSL connection. Getting Started with Linux .these to run under Linux. These connect either via a parallel port or a serial port. The set-up of this modem under SuSE Linux. There is also a "tarball" available at Ibiblio's website If you're feeling adventurous. Under SuSE Linux for example. If you have a serial mouse. The best and easiest way. USB modem support. I have found one in particular that is the easiest of all to use. In our case. you would hook it up to the second serial port. Motorola recently released a set of drivers for their "winmodems". this is quite easy. At this point you're asked to choose the hardware you want to configure and obviously you would choose 'Modem configuration' which is the second option. You should have your modem set up after you've done this. Most will do the job quite nicely. If you've installed Red Hat Linux. If you then get an external modem and you want to use it. com2. As you can remember from our lessons on other subjects such as hard drives and floppy drives. on my workstation. LinuxConf is also an all-purpose tool that includes modem configuration.8 kbps one before that. I used an external Dynalink 56 kbps modem.
2 etc. (what we covered in the previous section). The only problem I seemed to have with this was is known as the "negotiation" of the connection with my ISP. If you've picked out your windows manager already and it happens to be KDE. Once you've answered the questions and you have your connection setup. Euphemistically speaking. This protocol enables two computers to connect across a network. There are two protocols known as PAP and CHAP.realize that they have "permission" to communicate) or the type of data their sending is incompatible or both. What you essentially do when you set up your Internet connection is to make sure that pppd knows how to communicate the right information. There is a possibility to handle several different ISPs (at one point. the program I mentioned for KDE is called KPPP. When I first set up an Internet connection with Linux. With KPPP. The protocol basically provides the means for the two computers to first. This is standard issue on all versions of Red Hat since 6. it just might be a question of trying one or the other and sticking with the one that works. The K stands for KDE but what does the PPP stand for? It stands for Point-to-Point Protocol. A common problem . the program asks you a series of questions about your ISP. information which this company should have given you and about where your modem is located. I had 3 different ISPs configured). User of Red Hat have a very powerful and simple to use graphic tool with RP3. or pppd which is a program that provides for that communication between computers. identify themselves and then ask whether the computers can read the data each other sends. In your /sbin/ directory. so that's your first ISP. What eznet. This program has been greatly improved and your probability of success along with it.2 For the technically curious As you'll notice. I must confess that earlier versions of this program were not entirely successful in setting up my connection. you'll find the point-to-point protocol daemon. for other connections you may want to set up. you can also tune or tweak your connection speed to get better results from your hardware. then the connection fails. I created these files by hand without the help of one of these programs. If you run into this problem. which is another option. you're in luck because there is a program called KPPP which will set up a connection for you fairly painlessly. I suggest you check out the page Linux Dial-Up Networking in a Nutshell which has a nice list of the processes and files that come into play. Just substitute for 1. kppp. they couldn't do it. Basically. Other options If you use YAST in SuSE Linux you can set up your connection using WvDial. RP3 and other similar programs do are to create the necessary configuration files that pppd reads.Hipp's website and download the C source code and compile it. connection is nothing more than typing one command in a terminal: eznet up 0 The program starts counting ISPs with the number 0. It was an interesting exercise but essentially took a long time to figure out at those days. If the two computers either can't authenticate themselves to each other (ie. If you're interested in finding out what goes on behind the scenes.
30. I had good luck with that sound card (I still do because it still works).1). so that was pretty logical. into our actual numerical address. you're not reaching pages out there. then you'll have to add it again. The nasty hardware . www. You might want to have a look at their list. In that big box there was a bunch of stuff . SuSE. but if you don't see at least two lines like this: nameserver plus an IP address. Happy surfing with Linux! Getting Started with Linux .40. There are a lot of other supported cards. When I installed Slackware so many years ago (1997 seems like an eternity for Linux) I think I was more interested in making my sound card work than making the modem work to get connected. The symptom of the problem usually is that even though you've connected to your ISP. it should look something like this: nameserver 30. for example. My eternal gratitude to the people working on the Alsa Driver project.The most common problem I have come up against is that somehow the very important configuration file /etc/resolv. Sound Blaster uses the Alsa drivers to make sound come out of your Linux machine.conf.org.. I have always bought Sound Blaster cards. I was once bought a machine that did not have a Sound Blaster brand card in it and I was not able to get it configured under Linux. Sound Cards When I bought my first sound card in December of 1992. it came in a big box that Creative Labs sold me and it was a Sound Blaster.software (for Windows 3. These cards have usually configured fairly easily under Linux. Music has always been pretty important in my life long before the World Wide Web even existed. And see if your sound card is on their list. I honestly don't remember the name of the card and I promptly paid a little bit more money and exchanged that one for a real Sound Blaster and quickly got it running under Linux. If you're like me. This happens with some Linux distributions and the reasons are numerous and I usually chalk it up to what I called excessive "meddling" with important configuration files on the part of some major Linux distributions. Due to this.40. As I mentioned in the section on ADSL. That pretty much sums up setting up dial-up connections.linux.conf gets overwritten.30.. These people have made my life much richer as I can listen to lovely music as I write this lesson of the beginner's course.conf includes the two or more IP addresses of the domain name servers. unless.40 Your numbers will of course be different. you want it to. Then you should find out why and how your distribution is over-writing this file so it doesn't happen again.Lesson 18 Getting Linux to make sounds The hills are alive.30 nameserver 40. has a section in their YAST tool where you can configure it not to overwrite certain files like resolv. The first thing you should do is make sure /etc/resolve. a CD-ROM drive (with an insert-able cartridge that my 2 year old just managed to break after all these years!) and some Midi gadget which never interested me and is still in the same box in my attic. the first thing that interests you in setting up your computer is making it play sounds.. those machines that translate for example. particularly music. of course.
alsaconf If you're using Debian. I suspect that what it is doing is launching sndconfig . If your kernel doesn't have a clue about what to do with a one. is also available for Mandrake. it's important to point out that the Linux kernel needs to be configured to use a sound card. On my machines. • • • • sndconfig I mentioned this one above. If this is not the case. Strange hardware.2 is very much a thing of the past. the motherboard (that big thing inside a PC that you plug all the cards into) or mainboard as it is also known.4) are beyond the . KRUD. for example). depending on your distribution. just in case you're wearing headphones and you blow your eardrums out!! HardDrake Mandrake uses this graphical tool to configure hardware. If you use the SoundBlaster card. every install I have done in the past year and a half or so of a major Linux distribution has come with a kernel that has sound support in it by default. as I mentioned. The alsa-base package is also required. But if you are a true beginner (that's who this course is for) then you're probably going to get a "made for sound" kernel. It is also important to know what type of sound card it is in terms of the slots that it uses on your mother board in your computer.1 at the time of this writing and on that same machine. most major distributions will configure the sound card during the installation process. will accept ISA Plug and Play cards (bigger slots) and PCI cards (smaller slots). so I won't feign expertise here and give USB guidelines.I removed 7. then you might be beyond this beginner's Linux course and you probably already know how to make the kernel you want. you may use to any of the following tools.0 new) and it found and configured my Sound Blaster 16 card without the slightest problem.2 and installed 8. I did a "clean" install (I did not update . It is text based (runs it a terminal) and has always done a good job for me. The latest versions of Red Hat. It will play a sound bit of Linus Torvalds pronouncing the word "Linux" YAST This is SuSE's "Swiss Army Knife" of configuration tools. of course. Mandrake and Debian that I have installed are all sound enabled from the beginning. I wrote in a review of Mandrake 7. I'm not a USB user.2 in the Spring of this year (2001) about how it didn't detect my very mainstream Sound Blaster 16 card. It is a tool for Red Hat and distributions based on Red Hat (Mandrake. including sound cards. If you're installing "Joe's Home-brew Linux" distribution (where you must compile your own kernel).3 disks) and obscure distributions (Zingblatter's Ultra Linux 1. old versions of Linux (your cousin lent you the SuSE 5. You can adjust the default volume as well. Again. their cards do *not* work) are listed in red. you may also want to check out Creative Lab's page Configuration tools Before I go into the tools to use to get the sound card working. this is the package you need to set up sound. It warns you not to set it too high. Luckily. If you have an ISA PnP card (I have two) you also have to have the ISA PnP tools installed as well as a kernel that can use ISA Plug and Play (also known as plug and pray) As I mentioned. They're on version 8.which. Their latest version 2 is graphical. you can select the sound card and then push the button that says "launch configuration tool". there is precious little tools like sndconfig can do to help you. depending on. you should not have a problem. there was no problem detecting my sound cards with YAST. If the distribution you have installed (or are planning to install) is up-to-date. The good thing is that Mandrake 7. SuSE. You should now have a pretty good idea of setting up a sound card with a major Linux distribution. Using the GUI. It plays a little melody that's also the KDE default startup sound. whether or not the hardware is mainstream enough to be detected on install.manufacturers who do *not* share their information (and therefore.
You can also go to your favorite search engine (mine is Google ) and enter Linux sound card setup and you have access to the zillions of bytes of information on the topic. "Note to self . If you auction cattle in Iowa. For this lesson. The programs I use (which we'll talk about here) are great applications that work just as well as their graphic counterparts but in many ways are more easily configurable. I am not implying that there aren't some fine programs for playing and recording sound. I would just type the following" wavrec dave_note. When you make a recording of yourself or someone else speaking or you "rip" a track from a CD for later conversion to mp3 or ogg (we'll talk about this new and open format later). Here's an example: Let's say I want to record a note to myself that says the following: "Note to self: make sure you respond to Dave's email about SuSE'. There certainly is some nice stuff out there. so the tools for playing and recording sound here will be used from the command line. you're probably going to use the *. Besides. from the Beatles to Hans and his Swiss Alpine Yodelers. the most popular format for sound recording is is their *. My sentence above. so you should modify the time for the file. like this: wavrec -t 3 dave_note. MP3s etc. If you simply want to record yourself saying something using Linux. bla bla bla" lasts about 8 seconds.. at least for me.. The default recording time for 'wavrec' is 10 seconds. Let's go on now to all of the available programs to play all of that sound and music.Lesson 18 Now that we have our sound card working. if you don't specify a recording time on the command line (I didn't) you'll get a 10 second long sound file.wav format. I'd also like to add an editorial comment. Recording Sound Due to Microsoft's monopoly on operating systems (yes. you can take a look at the HOW-TO's on the subject. so I just have to set the CD or playlist and listen. we haven't begun to talk in depth about the use of the X-window system in Linux. are command line applications. we're talking about sound.wav . I really don't have to see anything.. then you probably don't need 10 seconds to say that sentence.wav make sure the microphone is on (you'd be surprised how many times I forget to turn it on!) and start talking. all you need is a microphone and and recording tool that gives you a file in this format. if I may. That means.scope of this course.wav format.. so if you're one of those out there who pine for the sweets sounds of Mozart flowing from your PC. it's time to check out some of the options that we have for playing sound. Of course. Getting Started with Linux . the duration of the sound file depends on whether you're talking a normal rate. It's easy because the default recording settings for this applications are all acceptable for getting a quality recording (if you've got a fairly good microphone). If you're following the course in order of the lessons. You just have to type some simple commands and you're all set. they have been convicted of this in a court of law). 'wavrec' is easy to use. we'll use 'wavrec'. I use a window manager but the programs I listen to CDs.
even 3 seconds might be pushing it for a cattle auctioneer. If you want to recite Abraham Lincoln's Gettysburg Address. if you take our a_sentence. if you use 'wavrec' with no options. Here's how: wavplay a_sentence. -S. I have purposely put the -t option in between them to avoid confusion. It's important not to confuse the -S (capital letter) with the -s (lower case). and play it like this: wavplay -s 44100 dave_notes. now. That's all there is to it. you must be asking the question: "I've made a *. I chose 44100 because this is a good high-quality sound which is necessary for my language teaching endeavors. it says that stereo is the default. I use this tool all the time to record short sentences for use in computer assisted language learning. If you would like to record Cuban leader Fidel Castro's speeches. Play it back to your friends using the -s 44100 option and have them rolling on the floor with your Alvin and the Chipmunks impressions. dave_notes. how do I hear it?" The answer is easy: With 'wavrec' 's companion program.wav Let's explain these options. After the -S. so if you do the math. It would seem there is an error in the man page. He once made a speech that lasted 7 hours. Issuing this short command and then changing the file name. then I would advise getting a huge hard drive. in seconds.wav you've cut the sample rate in half and so you get a really cool impression of the creatures that take over people's bodies in Star Trek's original series episode 'The Lights of Zetar'.wav This will play the sentence we recorded above. Here are the values I use: wavrec -S -t 5 -s 44100 a_sentence. you see that what we've done is double it's sample rate .wav then sing a line of your favorite song. means stereo . The first one. I should also point out that the same options in 'wavrec' are available for 'wavplay' if you want to add some effects to playback. then you would first multiply 60 and 2 to get 120 seconds. so you should type the number of seconds after.The -t option refers to seconds. . That is to say.wav and play it like this: wavplay -s 22050 a_sentence.wav file. If you look at the man page for 'wavrec' (type: man wavrec). That's because our note about Dave was recorded at the default 22050 hz. I have noticed that mono is in fact the default. You might want to do this: wavplay my_favorite_song. You can add all kinds of options to wavrec. Why this figure? Because Lincoln is reported to have taken only 2 minutes to give this famous speech. There you have it. we have the -t option for seconds (we explained before) then we have the -s option which is the sampling rate in Hz. Here. you get mono not stereo sound. Nevertheless.wav you'll find it's doubly fast. Just remember to give yourself enough time for what you want to say. Now. I get a lot of work done because my sentences seldom last more than 5 seconds and these values are fine for my work. 'wavplay'. -s takes a value in Hz while -S has no value. if you take our first wav file. For example.wav. Using the same logic. I have actually entertained my 2 year old son for hours with this.
like "call cousin Jack" and "remember to pay back gambling debts to bookie". You may have noticed that the name begins with zero. There is a system-wide crontab file for root's exclusive use. In our example. wavrec -t 3 0intro. I'll explain why we need that in a bit. The file is read by the program 'cron' and it carries out the instructions in it.wav file gets played first. or whenever you'd like. That is simple because for our reminder system.wav The crontab edit procedure uses your default command line editor which is probably 'vi'. By naming it '0intro. One of my favorite applications in Linux is called 'cron'. If everything sounds good to you. Here's a good way to use these tools. then we're ready for the next step which is to play our files automatically at a given hour. It can even be used to run a job that you do only in January. our wav files get played at the 30th minute of the 7th hour. whether that be once every three minutes. Now. that is to say 7:30 in the morning. I don't want to record Chipmunk sounds and sci-fi weirdness. that assures that it will be played first with our system. First. it's very simple to configure 'cron' to play our reminders. but there is also one available to every user to run command line apps that he or she is authorized to use.wav and say: "Remember to take out the trash". every hour. Three seconds should be enough for that. I suppose 5 seconds should be enough to say this. we invoke 'wavplay *' with the asterisk to play every file in that directory. once a day or every Thursday. I recommend using a YEAR-MONTH-DAY format plus some meaningful word for naming the wav files. followed by the hour [0-23] the day of the month [1-31]. To add a job to be done. This is because the crontab file must start with the minute [0-59] you want something done.wav Say something like "Your reminders" or "Reminders for you". But just because it's powerful. This is a pretty powerful tool that is used primarily by system administrators to automate their tasks and duties. It's powerful because it can schedule something to be run automatically at any time.I know what you're probably thinking. Now record some reminders. When you've got a few wav files in there you should play them to see that they've come out all right (you don't need to do this every time . just type: crontab -e Then we add the following line to our crontab file (-e is for edit) 30 7 * * * /usr/X11R6/bin/wavplay $HOME/reminders/*. plus a couple of other command line tools to read reminders to yourself in the morning.wav'. then. Well. just press 'ESC + i' before you add this line. Let's explain how a crontab file works. First. Let's create a sort of introductory wav file that's always going to be there. so if you don't remember our little tour of 'vi'. type: wavrec -t 5 2001-10-24_trash. For our purposes. we have to edit a file that is called 'crontab' and add our instructions. it doesn't mean it's complicated to use. For example.we're just practicing) wavplay * You'll see that the 0intro. the month of the year [1-12] and the day of the . create a subdirectory in your own directory /home/[you]/ mkdir reminders then go into reminders (type: cd reminders). I need to be productive. Try recording a few more reminders for different things.
wav comes in. I used this exact path because. you've got some free disk space. Speaking of that. 'Cron' will mail you when there is an error. In light of the Napster case. MP3 has become somewhat controversial. You just delete the daily ones by typing.wav that will play the reminders at 3:32 PM. so if you had no reminders for a given day. to show you that it works. because you won't hear them. you would at least have one file in the /reminders directory. . sharing MP3 files has opened up a Pandora's Box of questions about copyright.Lesson 18 MP3 format If you've touched a computer in the last couple of years you've at least heard about the MPEG layer 3 format. when you've finished hearing them. that is. 'cron' doesn't have to mail you an error message because the program 'wavplay' didn't find any *. made an MP3 file from a song on a CD. 7 days a week. Now.when I am just getting to work and I'm probably not listening to heavy metal at that hour of the morning. You have probably listened to an MP3 and you may have even "ripped a track".and how to make them under Linux. just give it a time within a couple of minutes or so. I never listen to heavy metal. fair use and intellectual property. Then adjust accordingly. If you want to test it. you might want to first edit your crontab like this: 32 15 * * * /usr/X11R6/bin/wavplay $HOME/reminders/*. That's the rationale for my 7:30 AM start time. That is to say. I am assuming that this is for security reasons.wav files. Getting Started with Linux . Just make sure you're not playing anything else.wav file in there. it would seem on my system. This tells 'cron' that these values don't matter. Some things are probably best left alone. so no harm done if you just put in the exact path in the crontab file. like MP3s. I mentioned before that I was going to explain why it's necessary to have it there. That way. To see if your system differs. We use the symbol $HOME for that. if it's 3:30 in the afternoon. you can delete them (if you want) That's where the rationale behind the YEAR-MONTH-DAY. then type: which wavplay to show you where the program is.MP3s . the master crontab file (found in /etc/crontab ) doesn't recognize that path automatically. The next step as you can see is to tell cron to run 'wavplay' and play the files in your home directory. We'll also talk about the new free audio format comparable in sound and space to MP3 .week [0-7] (where 0 and 7 are both Sunday). By deleting the unnecessary reminders. in the next part of the lesson we'll talk about those famous (and controversial) files that take up less space . That is. every month of the year. for example rm 2001-09-28* That keeps the 0intro.Ogg Vorbis. so I didn't go in and change the path.wav files every day of the month. Actually. Also notice how I have put the exact path to where wavplay is. cron should play our *. I have left the last three as asterisk. It's a good hour for me . popularly known as MP3. if free disk space is something that worries you. This really isn't the place to debate those questions but there are some issues related to the making of MP3s that concern Linux. Open Source and Free Software in particular.
We'll talk about the programs available to make sound files in MP3 format, but I should point out that MP3 is a non-free format. That is to say, the Fraunhofer Institute and Thomson Multimedia developed MPEG Layer 3 technology and they hold the patent rights it. If you want to write programs that encode and/or decode MP3 format, you have to pay licensing fees. Thomson has set up a website to talk about these issues, if you're interested. What does this mean for Linux? Well, if you are an advocate of the Open Source and/or Free Software model that Linux grew out of, MP3 might be seen as a format to be avoided. Actually, if you think this way, you now have an alternative with Vorbis' *.ogg format. We'll talk about that shortly. But being that MP3 is so prevalent nowadays and encoders/decoders do exist for Linux, we'll talk about making and playing MP3 files. Let's go back to our "reminder" system. If you go into the /reminders directory we created (cd reminders) and type:
ls -l *.wav
you'll see that the default quality of a 5 second recording gives us a file of about 1/4 megabyte. If we made the file a little better, as I do when I'm working with sample sentence for language learning, you doubled the file size to just under half a megabyte each. To check this, I made one of each format:
-rw-r--r--rw-r--r-28_fair.wav -rw-r--r-28_good.wav 1 mike 1 mike 1 mike users users users 132344 Nov 27 12:11 0intro.wav 220544 Nov 28 08:37 2001-11441044 Nov 28 08:34 2001-11-
If for some reason you wanted to keep these reminders, files of this size would quickly begin to take up space. Disk space is cheap, but there's no reason to occupy space if we can compress it. We could take out our tools gzip or bzip2 that we learned about in a previous lesson. 'bzip2' will actually get the file down to about half its original size:
-rw-r--r-1 mike 28_good.wav.bz2 users 206442 Nov 28 08:34 2001-11-
But there is a much better way of doing this, for now, by converting it to MP3 format. Look what we get for the same file as an MP3:
-rw-r--r-28_good.mp3 1 mike users 80234 Nov 28 08:48 2001-11-
You've got it down to about one fifth of its size. And you can hear it right away with an MP3 decoder/player. Let's show how we did this. First of all, you need a program that converts *.wav files to MP3 format. There are a few of these available for Linux. One of these, and probably the most popular, is Tord Jansson's BladeEnc. He's had some trouble with the MP3 patent holders so, again, we've stepped into controversy here. How do we avoid bringing patent holders' wrath down upon ourselves? Well, by going over to Fraunhofer's website and getting a demo of their MP3 encoder, appropriately called 'mp3enc' (the demo is actually called 'mp3encdemo' - very logical) we can convert these files in MP3 format. That will at least give us an idea about how all this works in Linux. You'll get a *.tgz (Slackware package) compressed file. Just unzip and untar in your home directory:
tar -zxvpf mp3encdemo.tgz (or whatever the current file is called)
There is a pre-compiled binary (aka - program that works right away) and some documentation (manual, other README files). There is a section in the manual that says "For the impatient". Being impatient by nature, I went right to that and found out how to convert my *.wav files to acceptable quality MP3s. Now, we're lucky that our reminders aren't very long, because the generous Fraunhofer people have given us a demo that only encodes 30 second long files. I know what you were thinking. You were going to run next door and borrow the neighbor's "Greatest Punk Love Songs" and start rippin'. We'll you're out of luck unless you want to do a medley. At any rate, the Fraunhofer demo will do nicely for learning purposes. To use the program, just pick one of the reminders and type:
mp3encdemo -br 128000 -if 2001-[whatever].wav -of 2001-[whatever].mp3
where [whatever] is the date of your reminder. Let's look at these options. -br stands for bitrate This is 128 kilobits per second and you'll get an acceptable, almost CD quality file. -if stands for "if it works" - naah - that's only a joke. (I couldn't resist). -if means input file, that is, the file your inputing or feeding to the encoder. Logically then, -of means output file, the MP3 file you're going to get. There you have it. Feel free to encode any files you want. (as long as they're under thirty seconds, of course) Actually any MP3 encoder for Linux that you can find out there works in basically the same way. You input a *.wav file with some options and you get an MP3 file. The program BladeEnc that we mentioned before, behaves similarly and there is no 30 second limit. (wink, wink, nudge nudge, and the author begins to whistle nervously)
Playing MP3 files
OK. Now we have our MP3 file. That begs the question: How can I hear it? Well, we need an MP3 decoder and/or player. I say "and/or" because these could be two different things under the x-window system. Popular graphic MP3 players are actually front-ends for MP3 decoders. That means they provide a graphic control panel for using a program that you don't really see. That's why I usually use the command line programs, as I mentioned earlier. So let's save some CPU power and learn how things work in the process. 'mpg123' is a very popular command line program for playing MP3 files. It is also highly versatile. You can create playlists and play songs in alphabetical order or in random order. You can even play little tricks and create weird disco versions of songs. (no kidding) You can even "reverse engineer" the MP3 file or even parts of it back to *.wav format. As far as I have tried, most graphic programs can manipulate playlists and add an echo effect but can't take full advantage of mpg123's features. You can only do it on the command line. Anyway, 'mpg123' comes with most major distributions. If you visit mpg123's home page you can find out all about it. You can also get source code and RPMs if you don't have it installed already. To simply play an MP3 file, enter the directory where the files are and type:
Let's say you already have a lot of MP3s. You may have gotten some ... then again, I don't want to know where you got them. You could random play them
mpg123 -z *.mp3
One of my favorite things to do is to create a playlist. Here's how I do it. This will be good review practice for the command line as well.
First, I enter a directory where I have MP3s:
Then I see what songs I have:
Then I pick out some songs that I particularly like and make a file that is going to be my playlist:
ls -1 Mozart_nightmusic.mp3 > favorites
The command 'ls' with the option '-1' lists the file name without any other information. The > symbol as you remember from our lesson on pipes, etc. creates a file called 'favorites' and includes the 'ls -1' output in it. To add more songs, we would repeat the same command, but this time we would (obviously) change the MP3 file name and most importantly we would change the one > symbol to two >> symbols. This way, we just add to the playlist file and we don't overwrite the file as would be the case if we didn't use two >> symbols.
ls -1 Beethoven_fur_elise.mp3 >> favorites
So I'd just keep adding songs until I had a nice playlist. To see the list, you'd just type:
If everything is satisfactory, then we can play these songs. Just type:
mpg123 -@ favorites
The email (@) symbol tells mpg123 to look for the playlist. That would play the songs in the order they are on the list. If you want to play them in random order, you would just add a -z before the -@ option
More fun with mpg123
Let's say you wanted to play "Name That Tune". Don't laugh! I have done this at parties. You know, you only play so much of a song and the people have to guess which one it is. Well, with mpg123, you're all set. This command will only play the first 50 "frames" of a song:
mpg123 -k 0 -n 50 Mozart_nightmusic.mp3
And you'll have the liveliest parties on your block! All courtesy of Linux and mpg123! Seriously, the -k option tells the program which frame to start at and then -n option indicates where it should stop. Pretty easy! You want more party ideas? Well, how about doing Techno-Mozart? That's easy too. Just type:
mpg123 -d 2 Mozart_nightmusic.mp3
This will make the program skip over every 2nd frame. That is, it will play a frame and skip one. This is *not* the Chipmunk effect. You will hear the same tone of voice because this doesn't effect the sampling rate of the file. It will just sound "techno" as I pointed out. Even though I mentioned parties and that, I have used this program and this effect in my language work for purposes of "serious" study. As the rate of the voice is not altered, you can change the number and see at what point people can't understand something. By this, you can test the aural skills of a person learning a
in a package called Vorbis-Tools. install in the order I have given you above and do this as the 'root' user .wav Mozart_nightmusic. free (as in beer and source code) Ogg Vorbis format. you should to go over to the Ogg Vorbis website and download some packages that are needed: libao. Their command line options are essentially the same. If you got your CDs from your cousin Larry with "Redhat" written on them in magic marker. you should have these libraries included on the CDs and be able to install this painlessly with your distribution's installation tools.rpm libvorbis-[whatever's current]. Well. The command line software for coding and playing the *.i386. after all that is said and done about MP3.wav format is at least 5 times bigger. As we mentioned before. If you do want to do techno-multimedia things with mpg123. Included in this last package are the programs oggenc and ogg123. you can use the -v option to get complete information about the track your playing. Though it is associated more with the Linux and Open Source world. before you try this at home. Ogg Vorbis is a good way to enjoy digital music in a compressed format. then feel free to go over and download the RPMs at www.com and install them. rpm rpm rpm rpm -i -i -i -i libao-[whatever's current]. You can read the latest news on the status of the Ogg Vorbis project at their website. if you have bought a boxed set of a major Linux distribution recently. Installation of the Ogg libraries First. Your imagination is the limit.ogg files can be found in there as well.language. Instead of skipping frames.wav format. KRUD etc. Also. There are even companies now using Ogg format for sound in their games.i386. you can also do the opposite by changing the -d X option to -h X. It just slows down the speed of playback. both Windows and Macintosh ports of the Ogg libraries are also available.i386.rpm libogg-[whatever's current]. These are designed to work in the same way as the packages bladeenc and mpg123 in the MP3 world. the *. these options do not produce the "slow-mo" or "Chipmunk" effects. so make sure you've got plenty of hard disk space.rpm vorbis-tools-[whatever's current].). You won't need those if you're running Red Hat or any RPM based distribution (like Mandrake. This is proof of its growing popularity as a digital music format. Remember. libogg and libvorbis These are the actual libraries that do the compression and decompression of the sound.wav sound effects files.mp3 You can also use the different options like -d or -h combined with the -k and -n to produce weird *.i386. I must confess that I don't like working with MP3s as much as I like working with the new. mpg123 -w Mozart_nightmusic. as you remember from our lesson on RPMs. you can also "reverse engineer" the MP3 file back to a *. Remember. By the way. mpg123 will play the same frame X number of times.Lesson 18 Ogg format Due to the restrictions on the use of MP3 technology. in order to listen to and make files in Ogg Vorbis format.rpm Note: Don't get the source RPMs (the one with 'src' in the title). Before you actually visit the site and start downloading. Getting Started with Linux .vorbis.
Un-zip and un-tar them and read the readme and/or install files which will instruct you how to get those packages installed and working. if you own them. Plug the line-out of the cassette player into the line-in input on the sound card. If you have stereo equipment that has a turntable and/or audio cassette player with line-out plugs. I took this from libogg's own README file: . It should look like this: . microphone red and line-in blue) or written on the metal bracket of the sound card.ogg format some old analog audio recordings that I had of a "garage" band I was in during the late 70's and early 80's. which the law allows.gz (the tarballs). You may have to fire up the Alsa mixer and change this.ogg files.Medical insurance (in case you get ill listening to the music) All sound cards have inputs for your speakers/headphones. then get the files ending with *.Lesson 18 My nostalgia project with Ogg Vorbis To try out the capabilities of Ogg Vorbis and the capabilities of Linux in general for manipulating sound I decided to convert to *. a microphone and a line-in cable (that is. Their function is either color coded (speakers are usually green. Type: alsamixer then. Now let's see what we can do with these libraries and programs to get some nice sounding *. How to digitally enshrine your past delusions of grandeur Needed: • • • • • One unsuccessful garage band of the 70's A cassette of music of rock star wanna-bes Audio cassette player with line-out plugs Cables to connect the player to your sound card optional . the line-out from stereo equipment). Some might have even listened to 8 track tapes and are afraid to admit it./configure make and optionally (as root): make install I guess you get the idea. Various cassettes were made of the original recordings and I wanted to preserve them digitally. this tutorial may also be applied to the possibility of making copies of records and tapes for yourself. That should activate your line in as the recording source. using the arrow keys. I am sure. Getting Started with Linux . It also gave me the opportunity to outline the procedure to use as a tutorial and to cowardly stay outside the realm of copyright infringement issues. There are. people using Linux who grew up in a time when the letters CD only meant "certificate of deposit" and who listened to vinyl records and audio cassette tapes. make your way over to the line-in column and push the space bar. Usually. the microphone is the default source for recording.tar.If you've got some other distribution like Slackware that works better with tarballs than RPMs (or if you are feeling adventurous/masochistic. These were produced before the first CDs ever appeared on the planet using 8 track reel to reel equipment in my best friend's basement.
I planned on using the wavrec program I mentioned earlier in this lesson to convert the analog tape audio to *. it worked. We never made an album. Being your basically lazy system administrator type. So I just continued doing this: wavrec -S -t 300 -s 44100 smoke_on_the_wafer. so I typed the following: wavrec -S -t 300 -s 44100 stairway_to_the_basement. Here's an example with one song: oggenc -b 192 -a "G-rage_Band" -l "Demo Tapes" -t "no_sympathy_for_the_neighbors" no_sympathy_for_the_neighbors. I figured that none of them could probably last longer than 5 minutes. .ogg" Let's explain some of the options.wav and pushing CRL + C at the end. The first trial run sounded fine using wavplay. • • • • -b stands for bitrate.wav files. Soon I had all my songs converted to *. You can change that for however many seconds that you like. -t stands for track or the name of the song. At first. Working with Oggenc Then I used oggenc to get them this format.wav -n "%a_%t.wav files. Then came the time to convert them to *. I didn't know the length of time the songs took to play.wav That meant that wavrec would continue to record for 300 seconds (ie 5 minutes).ogg format. I sure you remember the rest of the options from earlier parts of the lesson. Anything above 128 will give you good quality. My plan consisted in pushing CRL + C when the song came to an end. I decided to try a little trick. I chose 192 here because this is fairly good quality without being excessively big. so I just put "demo tapes" as you can see. I put my cassette in the player and I was ready to go. After the -a option you should put the artist (I use the term loosely in my case) in quotes. but I discovered a slight problem. Somewhat tarnished bronze oldies Now. The -l option is for the name of the album.You can also adjust the sound with the up arrow. I was afraid that would corrupt the data but when I tried it.
wav files made from LPs. One word of caution. so we'll show you some of the utilities out there for playing and ripping tracks from CDs.no hiss. brings one of the first CD players home to his fiancée. Getting Started with Linux . Once again. That's a good idea. type the name of the song whatever. enjoy all those old cassettes and LPs and if you were once a neighborhood Rock and Roller.that's not going into the file name) That should create some files in Ogg format for you.no scratches. we're not only talking about reading CDs but writing to them with CD-RW drives that cost under 200 US dollars. The CD. the DVD (Digital Video Disk) is becoming more and more popular everyday. Both MP3 and Ogg encoding is very CPU intensive. There is good explanation of the process at uklinux. Luckily. Well. records disappeared from all but collector's shops. ousted the LP record forever. just run the command: top and that will give you an idea. Soon software companies realized the potential for data storage in these little plastic disks and the CD-ROM market was born. Linux has never been behind in supporting these types of media. here's a way to do it. (Demo Tape excepted . almost 10 years later.Lesson 18 Compact Disks I love the scene in the Adam Sandler movie The Wedding Singer where the Yuppie junk bond trader Glenn Gulia. You've noticed that I have put underscores_between_words in true Unix filename fashion. I like to use command line programs to play CDs. Soon we will have affordable drives for home use that write to these disks as well. then try out the Ogg Vorbis tools and take a trip down memory lane. played by Drew Barrymore. but the sound quality is excellent!" I remember those days in 1980's when I heard my first CD and was amazed . Julia.it cost 800 bucks. CD players didn't stay around 800 US dollars for long. Now. Make sure you're not doing anything that needs a lot of CPU cycles at the same time.wav -n followed by "%a_%t. Not soon after the release of CDs and CD players. If you're interested in seeing just how CPU intensive this is. From about 1992 on the use of CDs in computers increased exponentially. Gulia exclaims: "It's a CD player. if you've got some old tapes or old records and you want to make copies for yourself. A spin-off of the CD.ogg" tells the program to name the Ogg file for the artist(%a) and the track (%t). My favorite one and I think the one that's easiest to manage is tcd by Tim Gerla .net.• • Now. Playing CDs As I pointed out earlier in the lesson on sound. as promised. There is software available to take the scratchy sounds from *.
==) 48423 (track 58677 (track 6 [0:00. that's a different story. it would seem). you can try out those as well. GUI based CD players are plentiful as well. 2001) (C) 2001 Monty and Xiphophorus Report bugs to paranoia@xiph. ripping your favorite songs and converting them to Ogg format to make it comfortable to play your favorite songs from your desktop doesn't entail you venturing into legal gray zones. Here's how it works: Let's say you wanted to rip track (song) 6 from a CD. Under X-window."6" The output would look something like this: cdparanoia III release 9. You can use 'tcd' to keep a database of your CDs for easy playing. the Linux program par excelence for doing that is cdparanoia .xiph.org/paranoia/ Ripping from sector to sector outputting to cdda. So. Here we're going to talk about one of the most widely used programs in the Linux world.8 (March 23. If you shared them however.wav (== PROGRESS == [ > | 050085 00 ] == :-) . The official position of this author is that ripping tracks from one's own CDs for personal use is OK by me (and the law. and when you've installed and configured your X-window system.You can control which tracks to play. Ripping CD tracks The whole Napster phenomenon. adjust the volume.duh) and type: cdparanoia -. eject the CD and do other things all from the keyboard. as I pointed out at the beginning of this article. you can fire up this baby in an x-term and enjoy hours of listening pleasure. cdparanoia is billed as a ripping tool for CD-drives that could be problematic.00]) 6 [2:16. It seems to work fairly well on the variety of speed drives that I have tried except for a couple of ancient ones. You would place the CD in the drive (I have forgotten that on occasion . if you're interested in ripping tracks from CDs.org http://www.54]) . For example. made the practice of converting songs on CDs "ripping as it is also called" very popular. It's available for download from the same people who bring you Ogg Vorbis.
In particular. To convert your ripped track to Ogg. but not the experience itself. If you want one big file. track03. You should be able to listen to. called 'cdda. the manual page (type: man cdparanoia) is a particularly well-explained one. named track01. Do not forget to type the double hyphens -before track numbers. Windows has become famous for essentially blurring the reality of what a computer really does. Anyway. create and manipulate sound with Linux. Getting Started with Linux . track02. just eliminate the -B option. .wav' (cdda stands for Compact Disk Digital Audio. Well. that concludes our lesson on sound. cdparanoia cdparanoia -B -.wav. most people who use computers equate Microsoft with computing. especially since the release of Windows 95. by the way) ready to be converted into your favorite compressed format.wav.So now you have track 6. has masked any trace of the traditional "black" computer screen experience.wav -n "%a_%t. type this: (change it to your info) oggenc -b 192 -a "The_Rubber_Band" -l "Gummed Up" -t "shes_elastic" cdda. there's a good source of information there. Why would you want to do this? A number of reasons you only like the awesome lead guitar part of a song? That could be.cdda. That is to say that Microsoft Windows."4[:45]-4[2:15]" The above example will rip track 4 starting at 45 seconds and end at 2 minutes 15 seconds into the same track.cdda. so if you want more examples.wav files."-5" This will rip tracks up to and including track 5 into separate *.ogg" Now you have a nice Ogg file that you can play with ogg123 Other options for ripping tracks with cdparanoia include: cdparanoia -B This will rip the whole CD into separate tracks. Here's a refresher. here's an interesting combination: cdparanoia -. It was still there . the only computing environment that most PC users have ever seen comes in the successive versions of their flagship operating system Windows(tm). computer scientists and people who have an interest in computers beyond the mere end-user stage know that graphic user interfaces or desktop environments like Windows really represent the look and feel of the computer experience. However. like Ogg.cdda. Just to finish off.wav etc.Lesson 19 Graphic User Interfaces with Linux Some preliminary commentary and perspective As much as I like Linux and think that it is the best operating system out there today.you just couldn't see it unless you purposely looked for it.
Now it's 2002 and Linux still offers the black screen and graphic user interface separately. chairman of the Microsoft Corporation once stated that: "Linux is 1960's technology with a new development model". a lot has happened since 1998. Getting Started with Linux . The sales of Windows 95 proved that with a good marketing campaign he was able to sell the idea that people didn't want it and people responded. more complaints about Linux's perceived lack of user friendliness outnumber complaints about Windows being essentially a Maginot Line solution for secure computing. Why? Because we're in a new world of connectivity. Linux's market share continues to rise. Then again. IBM has spent 1 billion US dollars on Linux and essentially gotten its investment back. In the mid-eighties at the Massachusetts Institute of Technology they came up with the X window system. Any attempt at using Linux as a desktop operating system to get "productive" work done (word processing. Hopefully in this lesson on graphic user interfaces under Linux. In 1992 the XFree86 Project was started. you'll get a good idea how the balance between user friendliness and security is a good one with our favorite OS. spread sheets) or to entertain . buttons and menus that make up a window. Icons. Windows development model was conceived before everybody's computers where connected to each other and it continues to reflect that. Bill Gates had already established that this was a no-no and so Linux gets chalked up as "retrograde". The problem was that Linux offered the black screen and the graphic user interface as a separate package. Microsoft was convicted of being a monopoly in restraint of trade. It still pales in comparison with Microsoft's desktop popularity . If you asked your average Linux enthusiast what he or she thinks of Windows. Development of X Window still continues under the auspices of the X Consortium. Though there are other equivalents to the libraries that XFree86 offers. For one. Then Linux started to gain in popularity and be noticed by a certain segment of the public around 1998-99.so much so that as most everyone knows. in 2000 and 2001 successive email viruses and worms crippled Windows-based IT departments and brought scores of corporate networks to a grinding halt. Pointer). was born on the Internet and grew up with it. There have been several versions of XFree86 and the current stable version at the time of this writing is XFree86 4. a project that essentially started the idea that computers could be used in an attractive graphical environment. Bill Gates' comment about Linux may be turned back now upon his own company. in order for those nice windows (yes. it is by far the most widely used window system under Linux. Menus. with a small 'w') to appear on your computer screen. The main idea behind this actually came from an earlier project at Xerox called WIMP (Windows. 1 The 'X Window system' provided the libraries to make the frames.Lesson 19 The GUI family tree Without getting into a lot of technical jargon. Linux. Microsoft spends most of its days now fighting security brush fires because in blurring the difference between the operating system and the graphic user interface it sacrificed security for ease of use. These libraries determine how a window is to appear. By 2002 standards it was a primitive GUI system to run programs with. But then again.Bill Gates. Unfortunately.0. you have to have some graphics libraries installed on your computer. This aimed to develop a free version of the X Window System. what it is supposed to look like and what the buttons and menus are supposed to do. however. What does he mean by this? I think basically that he bet his whole company on the assumption that people didn't want to see the traditional black screen and the command prompt anymore. you might get this reply: "Windows is pre-Internet technology with a slick new marketing campaign". That fact that you can use GUI based computing under Linux goes back to the time before Linux was even thought of.
This is a last resort and will almost always get you good results. 1999 Getting Started with Linux . It is graphical. then XFree86 and the X server for S3 cards should get installed. For example. in fact start X. mouse and monitor. 'Choice' is the key word here. with a program called xf86config. Of course. If you have an S3 card. Here are a couple of examples of what it looks like: . Now all of the major distributions have their own tools to get X running in no time. you have to know what card you have so the correct X server gets installed and you can have a graphical environment to look at after the install process is finished. then you can use XDM and have your favorite desktop there waiting for you. before you see your desktop utilities of choice. in text mode. There are two parts to this. The other is installing the X server that goes with your particular hardware. This is about the most user-friendly program I have yet encountered for X setup. like your keyboard. However. By having the command prompt and then issuing a command to start the GUI. In this case. if you're not interested in having more than one. given a situation where your X setup doesn't go smoothly. 1 The X Window User HOWTO by Ray Brigleb. major Linux distributions will also offer you the possibility of getting right into the GUI when you turn on your computer. you would turn on your computer and get the black screen and the command prompt. you can do this step by step. This program asks you questions about your peripheral hardware. the install process takes care of getting XFree86 on to your system. This is the Microsoft Windows influence on how things are done that I mentioned before. Then you would type: startx and your graphical environment of choice comes up. you can switch into any number of desktop environments "on the fly". we'll have to come up with a configuration so we can. Recently. but you may get asked what graphics card you have when you do a more interactive type of install of Linux. Regardless of the way you choose to start up your machine. we're going to have to configure XFree86 to use your monitor.Lesson 19 X-Window configuration In Linux days of yore. I explain this because some distributions do a pretty fine job of getting you up and running. SuSE offers a program called Sax. mouse and keyboard. Traditionally in Linux. whether you type startx or not. That is. With major distributions. This is done by way of the program XDM. One is installing XFree86 itself. listen to music. Mandrake offers their X configuration right in the install package so you go from start to finish all in the same package.oneself (play games. it used to be quite a task to get X-Window running even on a standard Intel type PC. watch TV) will start with the installation of XFree86. The X server is just the means of getting XFree86 to work with the graphics card that you have in your computer. so the simple fact that you can run it before you've even start configuring X is a good sign. if you have a graphics card from ATI. then you would install the XFree packages along with the X server package for ATI.
If you don't believe me. At this point in the configuration. if you don't answer the type of questions about your mouse correctly. It's beyond the scope of this lesson to explain what the vertical and horizontal refresh rates mean (actually. major Linux distributions have streamlined this process so you probably won't even need xf86config. as I mentioned.Lesson 19 To boot or not to boot (in graphics mode). Getting Started with Linux . this is what xf86config says It is VERY IMPORTANT that you do not specify a monitor type with a horizontal sync range that is beyond the capabilities of your monitor. you may not be able to use letters or symbols that exist in your native language. your monitor can get seriously damaged. In the past years. But it's nice to know you have it there. your mouse won't work. Or if you don't enter the country/language values for your keyboard layout. That is obviously important. especially if your hardware is proving to be less than cooperative. . that is the question. you can choose option 11 and enter your own values from the monitor's manuals and you'll be sure to get the correct settings. I don't mean to imply that the others are not important. Once you have passed this point. if you don't enter the values correctly for the type of monitor you have. it's the horizontal one that's a real stickler) but trust me . However. If you enter the vertical and horizontal refresh rates incorrectly. For example. your monitor will become just another useless piece of plastic and glass.you need to go get the manuals for your monitor and enter the real values when it asks you. the questions are more straight forward and errors have less grave consequences.The most important questions that this program will ask you about your hardware are the ones about your monitor. choose a conservative setting. like so many others waiting to be thrown away or recycled. If in doubt.
now that we're clear on whether to use a graphical start-up or not. or 'kdm' or 'gdm' which will start KDE or GNOME. The file name will depend on your distribution. Then type 'exit'. let's first see how our bare-bones XWindow setup is working. for example. you now want to startup graphically or viceversa. that is. you'll need to change the file /etc/inittab. You should change the line: DISPLAYMANAGER="" to: DISPLAYMANAGER="xdm" You may also use 'kdm' or 'gdm' here. two desktop environments that we'll talk about a little later. In the line: id:3:initdefault:. let's explore some of the possibilities for your Linux desktop. KRUD). Make sure that your CHECK_INITTAB setting is "yes" In the case of RedHat and RedHat based distributions (Mandrake. Your x-term session ends and your back in your terminal. Getting Started with Linux . The decision to startup graphically is made when you first install Linux.config. you can usually change this with your distribution's tools. just reverse all those changes above. change the default graphical login to a text mode login (something which I recommend). then you need to have a program like xdm. which will start your windows manager of choice.Before we start talking about the different windows managers and desktop environments that are available for Linux. Type this in your terminal window: xinit /usr/X11R6/bin/xedit This will fire up a simple text editor called 'xedit'. With SuSE. When you push 'quit'. It's better to use its powerful capabilities with a full-featured windows manager and desktop environment.Lesson 19 . so let's try a simple experiment with one of them. you'll notice you go back to your standard terminal. you may want to un-install 'xdm' (or gdm/kdm). You can change the start-up behavior by going to your /etc/ directory and changing a file. Do you want it to go directly to a graphical environment or do you want your machine to boot into text mode where you would then issue the 'startx' command? If you want graphics mode right away. Well. Try the same with an x-terminal: xinit /usr/X11R6/bin/xterm Type in a few commands. if you want to do just the opposite. If you found that you've changed your mind. Some X programs don't need a windows manager to run. If you decided not to use a graphical login. You can try writing something and pushing the buttons. the number 3 needs to be changed to a 5 As I mentioned. we should talk about how you want your computer to boot. There isn't any practical reason to use X-Window in this way. Before we go on to talk about choosing a windows manager that suits you. it is the file called rc.
of course. The advantage over Macintosh is primarily cost related. FVWM. There are more than two dozen different window managers available for Linux. It determines how it is going to reacted when you click in it or you reduce it or re-size it. After using Windows 95 from 1995 until the end of 1997 and testing various Mac OSes extensively (at one point using Mac OS 8 exclusively for one month . I'd rather pass that RAM savings on to the really important applications running on my computer.Choosing the look that's right for you In recent years.I was staying with relatives and needed to get some work done). which I feel has always been unwarranted. that the graphical user interface for Linux is at best. I have fun tweaking the configuration file. I just happen to like its minimalist approach and low memory requirements. They range from completely minimalist to well-engineered works of art. Window managers Most programs made for computers nowadays run in a graphic environment. then you've probably made the decision to try Linux. I have provided a screenshot (153k) of the my view on the world of Linux. It is also the most minimalist of the one's I've listed here. This is what a window manager does. I can safely say that Linux doesn't and probably hasn't had a reason to envy the other two major OS offerings in terms of graphic interfaces since about 1998. * I have a menu item that links to a script that will place a new picture as the desktop image when I get bored of the one I've been seeing for a couple of days (or hours. comparisons with the user friendliness of the omnipresent MS Windows and the well-deserved good reputation of the Macintosh OSes. the oldest of the aforementioned as well. I happen to like experimenting and I am prone to change it once a month or so (depending on that . I think the main reason that a lot of people prefer other windows managers to fvwm2 is that the file that sets up your desktop menus and buttons and other things has to be worked on by hand. Graphic user interfaces under Linux are comparable with these other ones in just about everything and even enjoy some advantages. If you're reading this. This is not meant to be an endorsement of this window manager. This is. However. the aspect of its buttons and frames. boring and at worst. members of Linux community have tried hard to shake off the reputation. This is based on. depending on my threshold of boredom at the moment). • • • • • • • the fvwm family Blackbox IceWM Sawfish Enlightenment WindowMaker AfterStep You can check out the above sites and find one that you like. Before we talk about what your Linux desktop is going to look like. The more popular ones make their way onto Linux distributions. is my personal favorite. The major one over MS Windows is. as far as I know. it became apparent that these programs would be more efficient if they could take their attributes from a common source. unmanageable. of course. They really prefer the click-as-you-go configuration of other window managers. we should first talk about the difference between a window manager and a desktop environment. stability and security. Here is a list of the ones that generally find their way onto the major distributions' CDs. The first one. It decides how the window is going to look. as Linux has become more popular.
Lesson 19 Protecting the environment Most computer users like to have a set of tools that they always see . There are two major desktop environments. Miguel de Icaza and Nat Friedman founded Helix Code in 1999 to oversee the business end of developing the GNOME desktop.fvwm2rc file behind the above screenshot. it is just a matter of which interface you like more. a region that displays the date. Previous uptime was 31 days. Getting Started with Linux . KDE made the decision to use libraries to create the desktop interface which were not open source. Peruse the offerings out there and choose one that suits your needs. We had a power blackout that lasted about 3 hours while a transformer in my neighborhood was being fixed. a button that displays a menu with the programs available for you to use. Helix Code later changed its name to Ximian.fvwm2rc and modified slightly. This is a uniform looking desktop interface which sits on top of and uses the services of a window manager. known as kwm GNOME or KDE The question: 'Should I use GNOME or KDE?' was a controversial one not so long ago. The libraries in question. This usually goes beyond the call of duty for a window manager.fvwm2rc. GNOME was founded in August of 1997 and was an attempt to create a uniform desktop manager that was totally compliant with the GNU's General Public License. People have become accustomed to an icon system that sits on a "desktop" that allows you. However. MS Windows users should take note of the uptime (last time of reboot) of 27 days. . I'd like to acknowledge that the main file was written by Jay Kuri. Raymond's (author of The Cathedral and the Bazaar) . You can check out the . to have your favorite program up and running or open a web browser to your favorite website. now. Thanks Jay. with a click of your mouse. In these cases you need the services of a "desktop environment". everyone is not into tweaking and prefer a more "clickable" configuration. wherever you are. avoiding the licensing issues involved in the case of KDE's using the QT libraries. which has its own background window manager. you would swear that you're seeing 5 different window managers. the ultimate user-friendly GUI experience for Linux. the issue inspired a young Mexican developer named Miguel de Icaza to create a desktop interface known as GNOME. Fvwm2 is so configurable that if you got 5 different configuration files. The controversy stemmed around the KDE project which was founded in 1996 with the goal of creating a uniform desktop experience for Linux . * There's a neat application called gkrellm that keeps track of a lot of things that are going on with the system besides displaying the time and date. known as . GNOME. at the time. Of course. You may also want to hold of on the window managers for a bit and read the next section. The main buttons you see are from Eric S.threshold of boredom factor again). off the Internet and tried them out. I don't remember what happened 31 days before that. I also included some tweaks that I got here and there. known as 'QT' are now open source. 21 hours. We talk about desktop environments. so the question is pretty much moot. which uses the services of independent window managers (at the time of this writing GNOME runs with Enlightenment) or KDE. Luckily.things like a clock.
Opera is a proprietary product and its source code is not freely available. it offers most of them. write email. if your distribution did not have this or you are reading this and have not yet installed Linux. With each . However. Regardless of the "look" you've chosen. Though the Linux version doesn't offer all of the features of their Windows version. write letters and a thousand other things you want to do. The rumors you hear about Linux lacking applications or not being able to "make it on the desktop" are false. MP3s and other music formats. Getting Started with Linux . Other than that. Konqueror Konqueror. There is no major application that a computer user needs that Linux lacks. agenda and scheduling software and address books. You can also download the latest versions from their homepages.What GNOME and KDE can offer Both of these desktop environments offer a Microsoft Windows-like experience. part of the KDE project. useful and important programs that run in X-Window At this point you've chosen your window manager and/or desktop environment. is a file manager and Internet browser wrapped up into one. you may want to check out both offerings. Where to get these desktop environments Most distributions come with both the GNOME and KDE desktop environments. you have to have programs to run. To date. Both offer a large selection of games in addition to other sundry applications for system monitoring and other miscellaneous tasks.Lesson 19 Popular. • • KDE homepage Ximian Inc. both offer top-rate productivity applications like email clients. It is available not only for Linux. They offer multimedia software for playing CDs. It is based on Mozilla. Though an ad-supported version is available free of charge. You need applications to surf the Internet. You can surf the net and manage your files at the same time. Internet/WWW Browsers Firefox Firefox is the most popular open source browser. but for the other major OS platforms. Opera Software of Norway released their first version of Opera for Linux in March of 2000. manage your files. Opera Billed as the "fastest browser". KDE is the only one of the two to offer an office suite for word processing and its own web browser. These early versions were not stable but the company kept working and slowly added features to their Linux versions. which is an open source re-write of the famous Netscape Navigator.
sans the virus problem. who developed this email client. if you get used to Mutt. However. you need to the desktop environment installed to run Konqueror. Using it efficiently requires a well-written . worker). complete support for HTML formatted mail and other useful features. address books and all those things that the busy yet organized person needs. friend. Now. Seeing that it has all the features of Outlook. Here we'll look at some of the major email clients for Linux. Kmail Kmail is KDE's major email client. If you have to respond to mail in different capacities (boss. Since it forms part of KDE. However. This one just sucks less. This client is a big hit with developers as it offers really nice threading (the ability to keep track of all mails based on one original mail) and a fairly good way of managing different email accounts. This is to distinguish it from the programs that sit on servers that receive and process emails either sent to or sent from you. easy to use fullfeatured email client. It's lack of a pretty interface is more than made up . you may not want to use Mutt just yet. that Mutt doesn't have a graphic user interface. It is not a complete groupware solution like Ximian's Evolution. That is true.Lesson 19 Email clients The program you use to get. intricate configuration of mail filters. this client is so popular in the Linux world that I just had to include it here. This was said by Michael Elkins. write and send your email is often referred to as a "client". part of the GNOME desktop project has received a lot of press lately. then you can see why it's getting some notice.muttrc file. Evolution Ximian's Evolution. new. Sylpheed offers the tools to do this all in one client. A lot of people will probably point out. you are probably not going to ever switch. If you are a newcomer to Linux. but its email management capabilities are very powerful. powerful features are added. and rightly so. Sylpheed Japanese developer Hiroyuki Yamamoto has developed this fast.subsequent version. than Ximian is probably the thing for you. If you're looking for a good email client that comes with scheduling tools. This is the main configuration file that determines how Mutt is going to work. task management.. Mutt One of the most famous quotes in the Linux world is the one found at the top of the home page for Mutt: All mail clients suck. let's look at some popular email clients available for Linux Getting Started with Linux . It is shaping up to be the only serious challenger to Microsoft Outlook's domination of the groupware scene. Email has become so important in our everyday life that I have observed that advocating one email client over another often takes on a fervor usually associated with religious beliefs. There is support for all major types of email transport.
Provides compatibility with Microsoft Office formats and smooth integrating into the KDE desktop. a personal finance manager GNOME-DB. The current stable version of this suite is 5. KOffice KOffice is the KDE Project's offering for desktop productivity. An evaluation version is available for download. Some of the high-lights include: • • • • Gnumeric.doc) files. this is the client you probably want to at least look into. It includes all of the standard office suite applications. HancomOffice for Linux Hancom Linux of Korea has developed this commercial full-featured office suite for Linux. If you handle a lot of email. but the software must be purchased in order to continue to use it. The project started with the Scheme in a grid spreadsheet. as a package deal. presentation software plus it offers web browsing and email and a few other features. all the standard office suite tool are offered here. full-featured office suite on the idea of Microsoft Office.Lesson 19 Office suites. GNOME Office GNOME office should actually appear in quotes. After you have some months behind you working with it.for by the ability you have to configure Mutt. a word processor (it even runs under Windows and MacOS) Gnucash. Siag Office Don't let a name like Pathetic Writer dissuade you from checking out this office suite for Linux. Once again. because this is not an office suite in the classic sense. Now you know why it's called Siag. The word processor part of the suite can open Microsoft Word format (*. This one boasts a Microsoft Office look and feel. Originally developed by StarDivision. emails will practically write themselves. database interfacing.2 at the time of this writing. StarOffice was acquired by Sun Microsystems in 1999. However. so to speak. VistaSource's Anywhere Desktop for Linux This suite was formerly known as ApplixWare. database connectivity software . Getting Started with Linux . Sun has announced that they plan to charge for downloads of StarOffice version 6. This is not a free product. The software is offered free of charge. Another free offering in the office category. but a set of applications that are often associated with office suites. It cost 99 US dollars at the time of this writing. spreadsheet. a spreadsheet application AbiWord. It comes complete with word processor (of course). word processors and spreadsheets StarOffice StarOffice is a complete.
If you download the Ximian Desktop. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. This is a full fledged image creating and re-touching application. xv In the words of the its author. literally. No more paying for dial-ups on a hourly basis. It looks like Gates and Co. you can go get RealPlayer for Linux and install it and start listening to web broadcasts. Well. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics. according to the dictionary I consulted: Smart. Now that I've finished my editorializing. xv doesn't stand for anything. Real Networks is at this point the only thing preventing them from doing it. No more painful downloads of software. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format. I live more than 6. you'll have no trouble getting used to this program. I use this program all the time. RealAudio player for Linux is just one of those little apps I'd rather not live without. If you're familiar with WinAmp. spruce. But what's more important than all of this is that I could now listen to radio! So what. my life changed forever. You'll be pleasantly surprised. That's a better description. Image viewing and editing The GIMP GIMP stands for GNU Image Manipulation Program. Getting Started with Linux . It is what I use to display the image in my desktop window. so when I could finally listen to a radio station from the city where I was born as easily as my mother (who still lives there) can switch on the radio. John Bradley. XMMS XMMS stands for the X multi-media system. then check out The GIMP. you say. I was delighted. RealPlayer I can't help but make an editorial comment here about this application.Lesson 19 Little goodies to improve your quality of life (aka: those little apps you'd rather not live without) Music When I got broadband Internet access. you'll get these applications plus the other productivity tools associated with the GNOME project. It should never be associated with the English word meaning lame. nice. You can apply all sorts of filters and even write scripts for doing things to the images automatically. plans on dominating the on-line music/information industry. trim.000 miles from the place where I grew up. Gimp also has another meaning. This for me represents more than just a way of listening to your favorite on-line radio station or viewing the BBC World Service broadcast. .
This next use of ImageMagick is my two-year-old's favorite. That pretty much sums it up. then you would type: display 'vid:*.type this: xv -root -max -quit your_favorite_pic. There are two that I use on two different occasions. xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware. Text editors and viewers Sometimes you don't want to fire up a whole office suite to read some text file and sometimes you have to create and/or edit documents as plain text.jpg' This creates one image of all of the jpg images as thumbnails in the directory you're in. just use the shift > keys or click with the right mouse button to call up the menu. you might want to consider doing them in small batches. Emacs There is a version of Emacs if your not using X-window and then there's XEmacs. Another one I use a lot is the thumbnail generator. which is like the console version. to modify my image rotation script above. first started working on Emacs in 1974. ImageMagick ImageMagick is a suite of tools for displaying and manipulating images. but has clickable menus and windows and everything you need to work in a graphical environment. xv is distributed as shareware. a version expressly written for X-window.jpg This starts up a slide show of him at blinding speed and he gets a big kick out of it. This takes up a lot of CPU power on even a fairly powerful machine. however. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. If you've got a lot of images in a directory and you want to have an inventory of all of them as one image. If you've got a lot of images in a directory and a slow machine. I refer to the x-window version of Emacs.jpg and xv will display your favorite picture as the pic on your desktop. This is the author's own words: Basically. for example. If you wanted. so be patient.jpg` do xv -root -max -quit $i sleep 300 done If you're looking for heavy duty image software. I use it for three basic things. Sometimes I get bored and I use this script to rotate my favorite pictures. founder of the GNU project. If you want to get the images rotating at a more manageable speed. you would open up a text editor. xv is not it. It has since then become the . I have some pictures of him in a directory and I type: animate *. Richard Stallman. #!/bin/sh for i in `ls /home/mike/rotation_bkg/*. The 'display' tool I use to tell my email client open images that people send me in emails.
You can see it in this screenshot. First. you can use xcolors to get a background and foreground combination that suits your eyes.flagship application of the GNU project.txt & As we're on the topic of basic X-Window applications. The ability to fire it up from an xterm with a couple of preferences of mine. It is not slick or fancy. like log files. you can use GNOME Color Browser. With xedit. If you're a programmer. after '-color' you should use the name of the color you want the text to appear in. The entire Linux Online beginners' course (yes. root-tail can be used to display these files on your desktop while you're running X-window. write something that you want to remember. If I could not use Emacs for some reason. you can specify a readable font and some good eye-friendly colors when you start it up. '-g' stands for 'geometry' or the location in the window. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history. It's useful as a way to alert you to how many clueless Windows users there are. Emacs is essential for working. It is a Swiss Army Knife of editors. It's running on the upper right side of my desktop. I would probably go off and herd sheep. To call it an 'editor' is to insult it somewhat. (and if you think I'm joking. The next one is '-font'. you run root-tail. Then. this is how I run it: root-tail -color yellow -font 12x24 -shade -g +10+100 $HOME/reminders & Let's explain some of these options. the words you are reading right now) were written in their entirety using Emacs. xedit xedit is a basic text viewer/editor for X-window. I normally use this to remember important stuff. Use the right mouse button to select a font color and the middle button to select the background. Even for non-programming tasks I use it. how much bandwidth you're using through your ethernet card and much. If you want to select colors (for example. It is truly the perfect application to be the one associated with the GNU. Use xcolors to find a color you like that's supported by your system. Then on each line. ask my wife). Miscellaneous Programs root-tail tail is a console application that is normally used for monitoring files that change constantly. you should create a text file with your favorite editor. First. Invariably. when some Sircam provoked mail . I use +10+100 which set it right in front of me. It does a little bit of everything. You can keep track of you memory usage. much more. It really comes in handy. '-shade' will give the text a little shade under it and will look snazzier. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names. it's almost like a minioperating system in and of itself. To me. xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file. I've chosen a good sized one. You can experiment with settings. Reading fairly long things on a computer is not one of my favorite activities. Now you have no excuse for forgetting to buy your loved ones presents on their birthdays! gkrellm This is nice little application to monitor what's going on with your computer. but there is one thing I like very much about it. It was one of the first applications. My eyes don't seem to like it either. It's best to do this with a few options. For example. for web page work) and you've got the GNOME desktop installed. As you see. Call it 'reminders'. swap space.
add: xclock -bg wheat -geometry 100x100+1+1 & sets the background color and the -geometry setting I have used here gives you a fairly small. but you're free to add stuff to it. You can use it to start programs automatically when you start X-window.Xdefaults . It's very easy to configure to your liking.Xdefaults_good because there is always some danger of making some applications non-operable because you have left spaces where you shouldn't. Have a look and we're sure you'll find the right programs to suit your needs Getting Started with Linux .comes through. Place your mouse over gkrellm and press F1 to configure other monitors. You can type: man xclock to see more options. Open the file with vi or the text editor of your choosing. Add this to it: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! emacs changes [date] emacs*Background: DarkCyan emacs*Foreground: Khaki . for example.xinitrc This is a file you'll find in your user directory. A lot of programs to choose from There are thousands of programs for Linux in our applications section. let's change the look of emacs.xinitrc file. First. but not too small clock in the upper left hand corner of your desktop. you can watch your CPU usage go off the scale when you do them. make a backup. It's best to leave what you find there. As an example. There are also plug-ins and themes/skins available. the 'eth0' monitor. open up the file with Vi or any text editor your prefer. Before you try to do this however. which checks bandwidth usage will start rising for no apparent reason. -bg . Type: cp .Xdefaults.Xdefaults file. It's fun to try out different styles and get some settings that please your eye.Xdefaults file There's another file in your user directory called . There is the possibility to use Python and Perl scripts to automate some things you do. Type: killall xclock to shut off the clock each time. If you do conversions of audio to MP3 or Ogg format. Xchat xchat is a comfortable IRC (Internet Relay Chat) client. It is important when you change settings that you leave no trailing spaces. Then.Lesson 19 Tips and Tricks for X-Window . for example. Just type your settings into an xterm and try different ones. Experiment with options first before you put your definitive xclock settings in your . You can use this file to change the way some of your X-window applications look. Most major distributions provide a working .
To make the changes take effect. With: emacs*Foreground: Khaki we've changed the color of the words in the menu. the exclamation point (!) in this file is used to make comments. For example. You don't have to do this. With: emacs*background: DarkCyan we can change the background of the application's menu bar and frame. Then we make the actual changes. xwininfo If you're interested in seeing a bit of information about certain programs running. you have to issue this command in an xterm: xrdb -merge $HOME/. You can use any color you like that the system supports.xinitrc file. The two rows of exclamation points I've used to show where my emacs section begins and ends.Xdefaults file that needs to be eliminated. you may have left some trailing white space. you'll make your desktop more to your liking. Xwindow keeps your old . then you've got whitespace in your . you can type xwininfo into a terminal and then click on any window. Restart emacs and you should see your new colors.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Let's explain what we've done here. If that is the case. If emacs doesn't come up. First.Xdefaults This will restart the x-server database and log in your changes. just type emacs in an xterm and an error message should appear saying something like: Warning: Color name "khaki " is not defined or similar. It's just something extra to remind me when I made the changes. I had another xterm open and I clicked on it and got this info: xwininfo: Window id: 0x2c0000e "xterm" Absolute upper-left X: 211 Absolute upper-left Y: 132 Relative upper-left X: 0 Relative upper-left Y: 0 Width: 581 Height: 340 Depth: 16 Visual Class: TrueColor Border width: 0 Class: InputOutput Colormap: 0x20 (installed) Bit Gravity State: NorthWestGravity Window Gravity State: NorthWestGravity Backing Store State: NotUseful Save Under State: no Map State: IsViewable Override Redirect State: no Corners: +211+132 -8+132 -8-128 +211-128 -geometry 80x24-3+109 This comes in handy especially to find suitable '-geometry' settings for use in starting up applications and including them in the . If you don't do this. As you get more adept at changing things.Xdefaults in memory and you won't see anything new. If you see a space before the second quotation mark. Then I use two to comment that I am changing emacs and I have included [date] where I would put the actual date to show when I made the changes. xset .
we told you how to use xv to put your favorite picture on your desktop. Of course. As we saw in previous lessons. you can use xsetroot to just put a color scheme on the desktop. keyboard. press: CTRL + ALT + F2 (or F3 up to F6) Then login as another user and type: startx -. The second one is very secure and can be used for transoceanic X-window sessions." You don't need to be David Copperfield to perform this magic.Lesson 19 More X-Window Tips and Tricks Starting X on other virtual terminals With Linux. Providing your bandwidth is good enough. to switch to another virtual terminal. For example. type: xset b off to stop your computer from beeping at it. The computer doesn't even need to be in the same room. Both GNOME and KDE have other graphic apps to do this stuff a lot easier. monitor and pc speaker. For example. I point to the computer across the room and then say: "Now I am going to start the browser from that system and make it appear here. You can also change the tone by typing something like: xset b 30 550 300 The first number is for volume. you are not limited to starting X-window only once. typing: xsetroot -solid seagreen will get you a solid dark green color as a background. You may open up another virtual terminal and start another instance of X-window. You only need X-window running on one and installed on the other. you can start a program on a computer 5000 kilometers away and use it on your desktop. you're free to use the color you like! Type: man xsetroot to see other options.This is a command line utility to control things like your mouse. And to turn it back on? You guessed it: xset b on. Remember though that running two instances will use up a lot of memory.:1 You can switch between instances of X-Window by typing: CTRL + ALT + F7 CTRL + ALT + F8 and Using the X-Window programs from another computer This is the thing I love to show people from the MS Windows world. the second pitch and the third duration of the beep. It's the same color used on pool and card tables. It can be in a different room in a different building on a different continent. One is not secure and probably should only be used on a local network. if at all. You also need a means of logging in to the other computer. There are two ways to do this. If you get tired of pictures and you want something plain. . And here's one more thing. Getting Started with Linux . This one is soothing to the eyes. But you can try it out. xsetroot In a previous section. so I find myself using this less and less.
if you want to do this locally. Let's use our 'amos' and 'andy' example again. The easiest way is to look for its PID by typing: ps ax | grep sshd and killing it's PID number. login into 'amos' (telnet> open amos) Then. As I mentioned. You should never do this if you're working over a public network. Most major distributions will offer this and it is normally installed by default. As long as you have a OpenSSH client and an account on the other machine. usually located in /etc/ssh that says X11Forwarding yes. It is becoming a serious threat to the dominance of Microsoft Windows not only in the server market but on the desktop as well.0 then export DISPLAY Now you can type the name of any program you want to run that you know is on 'andy'. Then. Then you need to restart the OpenSSH server. On 'andy' you need to login as 'root' and make sure that there is a line in a file called 'sshd_config'. You log in and then you can run the X application that you want. like the Internet. if your workstation is called 'amos' and the other machine is called 'andy' and you want to use a program on 'andy'. you can use this fairly safely in a local network. telnet is insecure. What goes over the network is encrypted and your security is not compromised. from 'amos' just connect to 'andy' via SSH. Using X on another machine. Remote X sessions with OpenSSH Open SSH stands for Open Secure Shell. It will come up on your desktop on 'amos' courtesy of 'andy'. Linux has come a long way in the past few years. Then type: sshd to start the server again. also known as X forwarding is usually disabled by default so you may have to edit one file to get this to work locally. you can do this. Remember though. as I mentioned. sitting at 'amos'. For example. evolving and adapting to user needs. Getting Started with Linux . Here's what you have to do. like so: ssh -l [yourusername] andy you'll be asked for your password. That's just what it is. type: DISPLAY=amos:0. The important work done by the people in the GNOME and KDE projects as well as other those carrying out development of other window managers . A secure shell for logging in at other computers in a secure manner. If you're doing this across oceans or continents the configuration will depend on the remote machine. you would type: xhost +andy Then with telnet.Lesson 19 A final word about X-window The GUI applications for Linux are always changing. This are better ways of doing this. You may have to specifically install the OpenSSH server which you need to have to for this to work on your local network.If you have the remote login device telnet and the telnet server installed on the machines. Make sure you have OpenSSH server on installed on 'andy' and have created a user account there. If this says X11Forwarding no than you need to change it to yes. You're sitting at your workstation called 'amos'.
At the same time you're listening to your favorite music in either MP3 or Ogg format. That's how Linux grew into the major operating system that it is and that's essentially what the Linux movement is all about. but to make you independent enough with your Linux machine that you don't need to seek outside help as frequently as a novice does to solve the occasional problems that arise. chat with friends. both positive and negative. You can translate the documentation or the graphic interface to your native language. You can also volunteer to do some work. Where do you go from here? At this time we're working on our Intermediate Linux Course. This course. What we have intended to do is take you from the point where you've got some Linux CDs and a computer in front of you without Linux in it to where you've installed and and you're using it productively. write documents . contact the developers or join the mailing list for that particular project and provide feedback. The fact is that there is an endless amount of things that you can do with Linux. Now it's up to you to explore. our beginner's introduction to this operating system. install the latest version and talk to your friends about how good you think they are.to try expanding on the things that you've learned here. You don't have to be a programmer to make a vital contribution. Our aim is not to make professional systems administrators out of those who follow the course. the point is to learn and to have a little fun in the process. In the end. This means that you're using it to maintain files. about the software you've tried.and XFree86 show the level of commitment there is to getting Linux on the desktops of the worlds computers in offices and homes. any form of collaboration is good. Here are a few of the topics that we'll be covering in the next course. In this lesson we've given you a number of addresses of web pages of these types of projects. on a CD or streaming over RealAudio. The best thing to do to support these efforts is to check back on these projects from time to time.Lesson 20 The end of the beginning This is the end of Getting Started with Linux. In the end. surf the web. which is still in development. That's essentially what the Linux movement is all about. keep figures straight with a spreadsheet. • • • • • • • • • • • general system administration security alerts Linux kernel compiling and installation of new kernels automating services and tasks use of Bash and Perl scripts firewalls setting up a web server with Apache setting up a mail server with sendmail Samba for Windows file sharing Professional databases MySQL and PostgreSQL Linux for the small business . write email. will take you from the beginner level to the point where you feel very comfortable with Linux. Also. manage data. Getting Started with Linux . for example. Our aim here was to give you the basics.
feel free to send us suggestions and comments through our webmaster return to the Linux Online homepage .If you are a registered user. all you have to do is sign up and you'll receive our newsletter with updates. we'll keep you posted on updates as to the availability of the Intermediate Linux Course. If you're not registered. Please.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.