Thursday, August 2, 2007
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.
The kernel
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.
Linux Today
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 user-friendly 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!
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.
The kernel
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.
Linux Today
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 user-friendly 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!
Installing 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?
This is a very difficult question to answer. To use an analogy, if I were going mountain climbing, I would need specific clothes to protect me from scrapes, the cold, wind, rain and other adverse climactic conditions. If I were going to a formal dinner, I would need a tuxedo. If I were going about my daily routine, I would wear "normal" clothes. There are computer world equivalents of mountain climbing and formal dinners as well as just sitting around the house. Linux has been fit into all those environments and more. There is even the equivalent of a swimsuit in Linux - a very scaled down version - just to cover the essentials.
Most PC users probably just need the everyday version. This kind of Linux has been widely available for some time now. Since Microsoft makes its living selling people "ordinary" operating systems, they have a lot to lose if Linux ever gets popular with the masses. 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. But in reality, Linux is just as easily installed and supports just as wide a range of hardware as Microsoft Windows does. The PR department at Microsoft is coming up with fewer and fewer reasons not to use Linux.
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. You may have heard of some of the companies and organizations that have created distributions for this platform, like Debian, Mandrake, Red Hat and SuSE . There are others as well. There are even versions of Linux that offer documentation and install programs in languages other than English. 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.
Linux Online maintains a list of all kinds of distributions. We invite you to consult that list before deciding on installing any version of Linux.
Prepare your manuals
As we mentioned before, the major versions of Linux have perfected their products to such a degree that they are very easy to install. 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. 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.
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. Major distributions of Linux have taken into account most standard hardware such as video cards, modems and sound cards, but as we said before, nobody can guarantee a problem-free installation for any operating system. Though you probably won't need them, they may help to track down a problem or prevent a future one. Now, go get those manuals, and we'll meet you in the next lesson!
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?
This is a very difficult question to answer. To use an analogy, if I were going mountain climbing, I would need specific clothes to protect me from scrapes, the cold, wind, rain and other adverse climactic conditions. If I were going to a formal dinner, I would need a tuxedo. If I were going about my daily routine, I would wear "normal" clothes. There are computer world equivalents of mountain climbing and formal dinners as well as just sitting around the house. Linux has been fit into all those environments and more. There is even the equivalent of a swimsuit in Linux - a very scaled down version - just to cover the essentials.
Most PC users probably just need the everyday version. This kind of Linux has been widely available for some time now. Since Microsoft makes its living selling people "ordinary" operating systems, they have a lot to lose if Linux ever gets popular with the masses. 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. But in reality, Linux is just as easily installed and supports just as wide a range of hardware as Microsoft Windows does. The PR department at Microsoft is coming up with fewer and fewer reasons not to use Linux.
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. You may have heard of some of the companies and organizations that have created distributions for this platform, like Debian, Mandrake, Red Hat and SuSE . There are others as well. There are even versions of Linux that offer documentation and install programs in languages other than English. 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.
Linux Online maintains a list of all kinds of distributions. We invite you to consult that list before deciding on installing any version of Linux.
Prepare your manuals
As we mentioned before, the major versions of Linux have perfected their products to such a degree that they are very easy to install. 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. 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.
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. Major distributions of Linux have taken into account most standard hardware such as video cards, modems and sound cards, but as we said before, nobody can guarantee a problem-free installation for any operating system. Though you probably won't need them, they may help to track down a problem or prevent a future one. Now, go get those manuals, and we'll meet you in the next lesson!
Partitioning
Your hard disk is like a pie. You can divide it into sections. Unlike a pie, after you've divided it, you can't give a piece to the dog. My dog did try to eat my hard disk once and he really relishes the floppies I leave lying around, but alas, I digress. For example, if you had two partitions, popular operating systems would generally call them C and D. You can call them Ginger and Fred, or Ginger and Marianne or even the Professor and Marianne if you like. I just use these bad jokes as a way of saying that C and D are naming conventions that belong to other operating systems. Linux doesn't use them. Linux may call them /hda3 and /hda5 for example. We'll get to that in a minute. Then you will need another partition known as a 'swap' partition. This 'swap' partition is just a way that Linux uses to get more memory so that you don't run out of it.
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, Will Robinson". There's a version for Linux but it doesn't mention Will Robinson. We want to say here that this is the SWAT team method of doing it - the scorched-earth policy of partitioning. If you have that important term paper on your hard disk, or pictures of that dream vacation to Hawaii that you haven't shown to your Aunt Betty yet or your best DOOM scores, you'll need to make back-up copies of them. The re-partioning using this method will get rid of them - forever! [cue ominous organ music].
But installing Linux isn't dangerous and if you choose to install you may not need such a drastic solution to your partition problem. As we mentioned before, If you're fortunate enough to have a hard drive with more than one partition (the old C: and D: routine), then it may be just a question of moving some files around. Unfortunately this lesson can't take into account everybody's individual circumstances.
There's a tool called FIPS that comes with major Linux versions. This will re-arrange your hard drive so you can install Linux. There are also other commercial products that will do the same. That may be an option for you, unless you've got a hard drive that's bursting at the seams. You should know that any decent working Linux system - and by decent, I mean, having the programs that will let you do anything you did with your Windows system- will take at least 2 gigabytes. Please keep that in mind. And if you want those photos of Hawaii on there, I'd plan for a bit more
To talk about where Linux and other operating systems should go. In any situation where you've got two things sharing the same space, like two people sharing the same apartment, one person will always exert his rights over the other. Other operating systems usually want to be the only ones in the computer, so even though it's really not going to be this way, you have to install them in the first 'primary' partition, and that way it thinks it's the only one there. That means installing it in /hda1 in Linux speak. So remember, if you've chosen to go the fdisk route, the other operating system should be re-installed first. When you've got that re-installed, you are free to install Linux in what's left. Once you've installed Linux, you can actually see the other system's partition, sort of like those phony mirrors at the supermarket. We'll talk more about that in another lesson.
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, Will Robinson". There's a version for Linux but it doesn't mention Will Robinson. We want to say here that this is the SWAT team method of doing it - the scorched-earth policy of partitioning. If you have that important term paper on your hard disk, or pictures of that dream vacation to Hawaii that you haven't shown to your Aunt Betty yet or your best DOOM scores, you'll need to make back-up copies of them. The re-partioning using this method will get rid of them - forever! [cue ominous organ music].
But installing Linux isn't dangerous and if you choose to install you may not need such a drastic solution to your partition problem. As we mentioned before, If you're fortunate enough to have a hard drive with more than one partition (the old C: and D: routine), then it may be just a question of moving some files around. Unfortunately this lesson can't take into account everybody's individual circumstances.
There's a tool called FIPS that comes with major Linux versions. This will re-arrange your hard drive so you can install Linux. There are also other commercial products that will do the same. That may be an option for you, unless you've got a hard drive that's bursting at the seams. You should know that any decent working Linux system - and by decent, I mean, having the programs that will let you do anything you did with your Windows system- will take at least 2 gigabytes. Please keep that in mind. And if you want those photos of Hawaii on there, I'd plan for a bit more
To talk about where Linux and other operating systems should go. In any situation where you've got two things sharing the same space, like two people sharing the same apartment, one person will always exert his rights over the other. Other operating systems usually want to be the only ones in the computer, so even though it's really not going to be this way, you have to install them in the first 'primary' partition, and that way it thinks it's the only one there. That means installing it in /hda1 in Linux speak. So remember, if you've chosen to go the fdisk route, the other operating system should be re-installed first. When you've got that re-installed, you are free to install Linux in what's left. Once you've installed Linux, you can actually see the other system's partition, sort of like those phony mirrors at the supermarket. We'll talk more about that in another lesson.
Plumbing with "pipes" in Linux
In this lesson, we're going to do a little plumbing. Plumbing with a computer? Well, Linux is so flexible that it even allows you to do plumbing with it. Well.... actually, it's just a little witticism of mine because the command we're going to learn in this lesson is called 'pipe', and plumbers work with pipes. To use the pipe command, you don't type: pipe. You press the '|' key. The location will vary on keyboards from country to country. This symbol is like two vertical slashes, one on top of the other.
This is the first time that we're going to see a command that's meant to be used with other commands. That means that the pipe will separate two commands so that they will be done one after the other. Let's try some plumbing.
For example, if you looked at the contents of your /proc directory with:
ls -l /proc
it would be too big to fit in one screen. So if we typed
ls -l /proc | more
you could scroll down with the ENTER key and see it all.
Actually, ls -l /proc | less is a better solution because you can scroll up and down with the arrow keys. Remember that in a previous lesson we said: "Less is more than more".
You're probably going to end up using this a lot. You're personal directory in /home will fill up and pretty soon 'ls -l' will overflow in your terminal or x-terminal window.
There's a little short cut if you've forgotten to use the pipe. You can also scroll up and down in a terminal with the SHIFT-PAGE UP / SHIFT-PAGE DOWN keys.
This is the first time that we're going to see a command that's meant to be used with other commands. That means that the pipe will separate two commands so that they will be done one after the other. Let's try some plumbing.
For example, if you looked at the contents of your /proc directory with:
ls -l /proc
it would be too big to fit in one screen. So if we typed
ls -l /proc | more
you could scroll down with the ENTER key and see it all.
Actually, ls -l /proc | less is a better solution because you can scroll up and down with the arrow keys. Remember that in a previous lesson we said: "Less is more than more".
You're probably going to end up using this a lot. You're personal directory in /home will fill up and pretty soon 'ls -l' will overflow in your terminal or x-terminal window.
There's a little short cut if you've forgotten to use the pipe. You can also scroll up and down in a terminal with the SHIFT-PAGE UP / SHIFT-PAGE DOWN keys.
The 'grep' command
In the last section we talked about the 'find' command which finds files. Now we'll talk about the 'grep' command which finds words in files. Your windows manager may have this incorporated into its find tool but then again, the beauty of Linux is having alternatives.
What does 'grep' mean?
'grep' is a Vulcan word that means "find". Actually it isn't, but it sort of looks like it, doesn't it?
Kirk: "Find the solar system L10J, Mr. Spock."
Spock: "Grepping now, Captain." *
* Star Trek stuff copyright Paramount Pictures
Let's have a little practice session with 'grep'. The best way is learning by doing, so let's do it.
A 'grep' mini-tutorial
With 'pico' or any Linux text editor, create a file called 'mary1.txt'
pico mary1.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.
Then create: mary2.txt and enter the text Mary had a little cow.
Save that and create the file: mary3.txt and type: Mary had a little too much to drink. Now we know what Mary was doing when she wasn't watching her lambs! Now save that file.
OK, now we're ready to try out 'grep', so phasers on stun and let's go.
Type the following command:
grep Mary mary*.txt
Let's explain this a little. 'grep' looks for the word "Mary" in any text file that is called "mary(something).txt". You've created three files that start with 'mary', so the asterisk makes sure that 'grep' will look for the word 'Mary' in all three.
You should get this output:
mary1.txt Mary had a little lamb
mary2.txt Mary had a little cow
mary3.txt Mary had a little too much to drink
The word 'Mary' is in all of those files, so you'll get this output.
If you type grep little mary*.txt you'll get the same output because the word "little" is also in each of those files. But if you type the word "cow", you'll get this output:
mary2.txt: Mary had a little cow
because the word "cow" is only in mary2.txt.
Typing grep drink mary*.txt will get us more or less the same, only that mary3.txt will show up instead of mary2.txt.
Well, there's 'grep' in a nutshell. It's been a pleasure 'grepping' with you!
What does 'grep' mean?
'grep' is a Vulcan word that means "find". Actually it isn't, but it sort of looks like it, doesn't it?
Kirk: "Find the solar system L10J, Mr. Spock."
Spock: "Grepping now, Captain." *
* Star Trek stuff copyright Paramount Pictures
Let's have a little practice session with 'grep'. The best way is learning by doing, so let's do it.
A 'grep' mini-tutorial
With 'pico' or any Linux text editor, create a file called 'mary1.txt'
pico mary1.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.
Then create: mary2.txt and enter the text Mary had a little cow.
Save that and create the file: mary3.txt and type: Mary had a little too much to drink. Now we know what Mary was doing when she wasn't watching her lambs! Now save that file.
OK, now we're ready to try out 'grep', so phasers on stun and let's go.
Type the following command:
grep Mary mary*.txt
Let's explain this a little. 'grep' looks for the word "Mary" in any text file that is called "mary(something).txt". You've created three files that start with 'mary', so the asterisk makes sure that 'grep' will look for the word 'Mary' in all three.
You should get this output:
mary1.txt Mary had a little lamb
mary2.txt Mary had a little cow
mary3.txt Mary had a little too much to drink
The word 'Mary' is in all of those files, so you'll get this output.
If you type grep little mary*.txt you'll get the same output because the word "little" is also in each of those files. But if you type the word "cow", you'll get this output:
mary2.txt: Mary had a little cow
because the word "cow" is only in mary2.txt.
Typing grep drink mary*.txt will get us more or less the same, only that mary3.txt will show up instead of mary2.txt.
Well, there's 'grep' in a nutshell. It's been a pleasure 'grepping' with you!
Commands to control your system
ps
'ps' will give you a list of the processes running on your system.
If you happen to forget what your name is, you can type ps -u. This is the user mode and your user name will appear in the first column. Actually, there's more than that. There will be other columns about memory usage, the time you started running the processes and others.
You can see other users processes if you type ps -au. If you're not using a networked computer, you will see yours and root's processes. If you're into detective work, you can type just ps -a and try to guess who's using the process.
The information that you'll probably be most interested in is the column that shows the "process ID" or "PID". We'll get into why these are so important in the next part of the lesson.
'ps' will give you a list of the processes running on your system.
If you happen to forget what your name is, you can type ps -u. This is the user mode and your user name will appear in the first column. Actually, there's more than that. There will be other columns about memory usage, the time you started running the processes and others.
You can see other users processes if you type ps -au. If you're not using a networked computer, you will see yours and root's processes. If you're into detective work, you can type just ps -a and try to guess who's using the process.
The information that you'll probably be most interested in is the column that shows the "process ID" or "PID". We'll get into why these are so important in the next part of the lesson.
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. That is to say, the way data is stored and managed in Linux.
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. Linux users that use KDE or GNOME can also copy files in that way to different parts of the hard drive. However, if you would like to use floppies, we should talk here a bit about the type of file system Linux uses.
MS-Windows, from Windows 95 on up uses a file system called 'vfat' Linux uses a different system called 'ext2'. There are also other types of file systems out there. You may have chosen to have both Windows and Linux installed in your computer. At one point, you might have to access files in the Windows partition of your hard drive. You would use a command called 'mount' to do that. 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.
On the same idea, though floppies are becoming somewhat obsolete, you may want to store some files on a floppy or access data on a floppy that someone has given to you. You would also have to use the command 'mount' before you copied data to or got data from a floppy disk. If that person is a Windows user, then you would have to indicate once again that the file system is 'vfat'. If you want to copy data from your Linux partition to a floppy, you would have to format and then "mount" the floppy as a Linux 'ext2' file system.
Formatting a floppy for Linux
Most floppies sold on the market are pre-formatted for MS-Windows. You can copy data from Linux to a Windows formatted floppy with no problem. 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, then it might be better to format the floppy for Linux's ext2 file system.
We should also say now that this is considered an administration task. You have to be working as 'root' to be doing this. As you get more familiar with Linux, you can use commands such as 'su' to do the work of root on certain occasions when you're not actually working as root. We'll explain this command in later lessons.
To create a linux floppy "by hand", 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". The other part is the device, your floppy drive, which is known to Linux as "fd0" (floppy drive 0). As we mentioned in the first part of the course, everything is a file in Linux, including your floppy drive.
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 now have a Linux formatted floppy. 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.
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. Linux users that use KDE or GNOME can also copy files in that way to different parts of the hard drive. However, if you would like to use floppies, we should talk here a bit about the type of file system Linux uses.
MS-Windows, from Windows 95 on up uses a file system called 'vfat' Linux uses a different system called 'ext2'. There are also other types of file systems out there. You may have chosen to have both Windows and Linux installed in your computer. At one point, you might have to access files in the Windows partition of your hard drive. You would use a command called 'mount' to do that. 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.
On the same idea, though floppies are becoming somewhat obsolete, you may want to store some files on a floppy or access data on a floppy that someone has given to you. You would also have to use the command 'mount' before you copied data to or got data from a floppy disk. If that person is a Windows user, then you would have to indicate once again that the file system is 'vfat'. If you want to copy data from your Linux partition to a floppy, you would have to format and then "mount" the floppy as a Linux 'ext2' file system.
Formatting a floppy for Linux
Most floppies sold on the market are pre-formatted for MS-Windows. You can copy data from Linux to a Windows formatted floppy with no problem. 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, then it might be better to format the floppy for Linux's ext2 file system.
We should also say now that this is considered an administration task. You have to be working as 'root' to be doing this. As you get more familiar with Linux, you can use commands such as 'su' to do the work of root on certain occasions when you're not actually working as root. We'll explain this command in later lessons.
To create a linux floppy "by hand", 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". The other part is the device, your floppy drive, which is known to Linux as "fd0" (floppy drive 0). As we mentioned in the first part of the course, everything is a file in Linux, including your floppy drive.
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 now have a Linux formatted floppy. 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.
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, a CD-ROM drive and another partition of your hard disk (the Windows partition, for example). Though some windows managers for Linux have provisions for clicking on an icon to access a floppy drive, for example, the method behind this is quite different from other OSes. In Linux the floppy drive or other device must be "mounted". That means basically, incorporating it temporarily into your Linux file system or, in other words, 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, 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, the floppy type (indicated by the option -t) is a Linux formatted floppy. If you want to mount a Windows floppy, change the option to -t vfat
* in your root directory (you can get to it by typing: cd /), you have a directory called floppy. If you don't, you should create it (mkdir floppy). Some Linux distributions create this automatically during the installation process. Some don't.
Let's explain what we've just done here. 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, as if it were just another directory on our Linux system. If you did it right, 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, to copy to and from the floppy disk, you would type:
cp my_file /floppy
If you wanted to create individual subdirectories on the floppy, you would first change to the /floppy directory:
cd /floppy
Then you would use the mkdir command to create the directories you want. You can also use the command cp -r my_directory/ /floppy to copy the directory automatically to the floppy. (make sure you have space! - 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.
If you would like to get some files from a CD-ROM, the standard command to do this is:
mount -t iso9660 /dev/hdb /cdrom
The type, iso9660 is the standard file system for a CD. The device (/dev/hdb) is the non-SCSI type of CD-ROM and the mount point (/cdrom) should exist. If it doesn't, you should create it in the root directory with 'mkdir', just as you may have done with the /floppy directory.
Remember that the concept of CD-ROM is read only. You won't be able to write to this type of CD-ROM drive. A message will tell you that when you mount this type of device.
Mounting another partition of the hard disk.
Many people may have preferred to install Linux along with another operating system. You may have Linux and Windows installed in the same computer. 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, so that's why we've used the device /hda1 (hard disk partition 1). The choice for /mnt is the standard mount point in this case. You may use the /mnt directory to mount the other devices (floppies, CDs) as well. I use the different empty directories (/floppy /cdrom /mnt) to avoid confusion.
If you change to the mount directory (cd /mnt) and then type: ls and you'll see something interesting. The directories are blue but the files are green (or red - depending on your distribution of Linux). You won't have the various color combinations as you do in Linux. That's because Windows' file system doesn't distinguish file types. Everything looks like it's a program (binary) instead of a regular file.
When you copy files from the Windows partition to the Linux partition you should bear this in mind. For example, if you wanted to copy an mp3 file from the Windows partition to the Linux partition to test out your sound configuration, it would show up as a executable program and not just a standard file under Linux. This doesn't effect your playing it, but for a more accurate accounting of what you have on your system, you may want to change the permissions of the file so that it shows up as a regular file in your color scheme. We'll talk about file permissions and and making changes to them shortly.
We've mentioned previously that there's a different idea in Linux as to what constitutes a floppy disk drive, a CD-ROM drive and another partition of your hard disk (the Windows partition, for example). Though some windows managers for Linux have provisions for clicking on an icon to access a floppy drive, for example, the method behind this is quite different from other OSes. In Linux the floppy drive or other device must be "mounted". That means basically, incorporating it temporarily into your Linux file system or, in other words, 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, 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, the floppy type (indicated by the option -t) is a Linux formatted floppy. If you want to mount a Windows floppy, change the option to -t vfat
* in your root directory (you can get to it by typing: cd /), you have a directory called floppy. If you don't, you should create it (mkdir floppy). Some Linux distributions create this automatically during the installation process. Some don't.
Let's explain what we've just done here. 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, as if it were just another directory on our Linux system. If you did it right, 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, to copy to and from the floppy disk, you would type:
cp my_file /floppy
If you wanted to create individual subdirectories on the floppy, you would first change to the /floppy directory:
cd /floppy
Then you would use the mkdir command to create the directories you want. You can also use the command cp -r my_directory/ /floppy to copy the directory automatically to the floppy. (make sure you have space! - 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.
If you would like to get some files from a CD-ROM, the standard command to do this is:
mount -t iso9660 /dev/hdb /cdrom
The type, iso9660 is the standard file system for a CD. The device (/dev/hdb) is the non-SCSI type of CD-ROM and the mount point (/cdrom) should exist. If it doesn't, you should create it in the root directory with 'mkdir', just as you may have done with the /floppy directory.
Remember that the concept of CD-ROM is read only. You won't be able to write to this type of CD-ROM drive. A message will tell you that when you mount this type of device.
Mounting another partition of the hard disk.
Many people may have preferred to install Linux along with another operating system. You may have Linux and Windows installed in the same computer. 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, so that's why we've used the device /hda1 (hard disk partition 1). The choice for /mnt is the standard mount point in this case. You may use the /mnt directory to mount the other devices (floppies, CDs) as well. I use the different empty directories (/floppy /cdrom /mnt) to avoid confusion.
If you change to the mount directory (cd /mnt) and then type: ls and you'll see something interesting. The directories are blue but the files are green (or red - depending on your distribution of Linux). You won't have the various color combinations as you do in Linux. That's because Windows' file system doesn't distinguish file types. Everything looks like it's a program (binary) instead of a regular file.
When you copy files from the Windows partition to the Linux partition you should bear this in mind. For example, if you wanted to copy an mp3 file from the Windows partition to the Linux partition to test out your sound configuration, it would show up as a executable program and not just a standard file under Linux. This doesn't effect your playing it, but for a more accurate accounting of what you have on your system, you may want to change the permissions of the file so that it shows up as a regular file in your color scheme. We'll talk about file permissions and and making changes to them shortly.
Umount command - unmounting file systems
Mounting file systems that aren't part of the standard Linux system is considered a temporary condition in Linux. Now that we know how to mount these outside file systems in Linux, the important thing now is to learn how to unmount it when we're finished using it.
In the early days of Linux, you could do serious damage to your system if you didn't unmount manually after you were finished. Nowadays if you have mounted a system and you shut down the computer without unmounting, the chances are pretty slim that you're going to trash a file system. Slim, however, isn't good enough for me. I'd rather not take a chance. I always take the time to unmount these external file systems when I'm finished with them.
The command for this is:
umount [/mount point]
In the examples I used in this lesson, the mount points were:
* floppy: /floppy - therefore umount /floppy
* CD: /cdrom - umount /cdrom
* Windows partition - umount /mnt
Remember also to NOT be accessing the floppy etc. when you use umount or it will give you a drive busy message. If you get this, you may have left a terminal open where you were using to copy or write to the particular drive. Check your terminals if you get this error.
I just wanted to point out another thing too. You are 'unmounting' but the command is umount (that is, without the N of un) Being u(n)familiar with the mount concept when I started with Linux, I typed unmount instead of umount and much to my surprise, I got the message: command not found. U(n)deniably, I had done something wrong. It took me a while to figure out that the command didn't include an N. I haven't really done a survey on how many people have actually done this. For all I know, I may be the only person who has, but I just thought it best to warn you.
Well, now you can use the standard devices that most PC users need. Later in our advanced class we'll talk about installing and using other devices like scanners, CD writers, Zip drives and matter/anti-matter flow inducers. (well, maybe we'll save that last one for the super-advanced classes!)
In the early days of Linux, you could do serious damage to your system if you didn't unmount manually after you were finished. Nowadays if you have mounted a system and you shut down the computer without unmounting, the chances are pretty slim that you're going to trash a file system. Slim, however, isn't good enough for me. I'd rather not take a chance. I always take the time to unmount these external file systems when I'm finished with them.
The command for this is:
umount [/mount point]
In the examples I used in this lesson, the mount points were:
* floppy: /floppy - therefore umount /floppy
* CD: /cdrom - umount /cdrom
* Windows partition - umount /mnt
Remember also to NOT be accessing the floppy etc. when you use umount or it will give you a drive busy message. If you get this, you may have left a terminal open where you were using to copy or write to the particular drive. Check your terminals if you get this error.
I just wanted to point out another thing too. You are 'unmounting' but the command is umount (that is, without the N of un) Being u(n)familiar with the mount concept when I started with Linux, I typed unmount instead of umount and much to my surprise, I got the message: command not found. U(n)deniably, I had done something wrong. It took me a while to figure out that the command didn't include an N. I haven't really done a survey on how many people have actually done this. For all I know, I may be the only person who has, but I just thought it best to warn you.
Well, now you can use the standard devices that most PC users need. Later in our advanced class we'll talk about installing and using other devices like scanners, CD writers, Zip drives and matter/anti-matter flow inducers. (well, maybe we'll save that last one for the super-advanced classes!)
File permissions in Linux
Linux has inherited from UNIX the concept of ownerships and permissions for files. This is basically because it was conceived as a networked system where different people would be using a variety of programs, files, etc. Obviously, there's a need to keep things organized and secure. We don't want an ordinary user using a program that could potentially trash the whole system. There are security and privacy issues here as well. Let's face it, we don't want Bill to read Bob's love letters to the Janet who works in R & D. (because Janet is Bill's fiancée) In the end, it's important to know what belongs to me, to you and to everybody.
As we mentioned at the beginning of this course, the big advantage that Linux has is its multi-user concept- the fact that many different people can use the same computer or that one person can use the same computer to do different jobs. That's where the system of file permissions comes in to help out in what could be a very confusing situation. We're going to explain some basic concepts about who owns the file and who can do what with a file. We won't get into an enormous amount of detail here. We'll save that for the Linux system administration course. We will show you how to understand file permission symbols and how to modify certain files so that they're more secure.
File permission symbols
If you run the command ls -l in your home directory, you will get a list of files that may include something like this
-rw-r--r-- 1 bob users 1892 Jul 10 18:30 linux_course_notes.txt
This basically says, interpreting this from RIGHT to LEFT that the file, linux_course_notes.txt was created at 6:30 PM on July 10 and is 1892 bytes large. It belongs to the group users (i.e, the people who use this computer). It belongs to bob in particular and it is one (1) file. Then come the file permission symbols.
Let's look at what these symbols mean:
* The slash marks - separate the permissions into three types
* The first part refers to the owner's (bob's) permissions.
* The slash mark - before the rw means that this is a normal file that contains any type of data. A directory, for example, would have a d instead of a slash mark.
* The rw that follows means that bob can read and write to (modify) his own file. That's pretty logical. If you own it, you can do what you want with it.
* The second part of the these symbols after the second slash, are the permissions for the group. Linux can establish different types of groups for file access. In a one home computer environment anyone who uses the computer can read this file but cannot write to (modify) it. This is a completely normal situation. You, as a user, may want to take away the rights of others to read your file. We'll cover how to do that later.
* After the two slash marks (two here because there is no write permissions for the group) come the overall user permissions. Anyone who might have access to the computer from inside or outside (in the case of a network) can read this file. Once again, we can take away the possibility of people reading this file if we so choose.
Let's take a look at some other examples. An interesting place to look at different kinds of file permissions is the /bin directory. Here we have the commands that anybody can use on the Linux system. Let's look at the command for gzip, a file compression utility for Linux.
-rwxr-xr-x 1 root root 53468 May 1 1999 gzip
As we see here, there are some differences.
* The program name, date, bytes are all standard. Even though this is obviously different information, the idea is the same as before.
* The changes are in the owner and group. Root owns the file and it is in the group "root". Root is actually the only member of that group.
* The file is an executable (program) so that's why the letter x is among the symbols.
* This file can be executed by everybody: the owner (root), the group (root) and all others that have access to the computer
* As we mentioned, the file is a program, so there is no need for anybody other than root to "write" to the file, so there is no w permissions for it for anybody but root.
If we look at a file in /sbin which are files that only root can use or execute, 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. As we can see here, only root, the owner of the file, is allowed to use this program. There are no x permissions for the rest of the users.
We hope you enjoyed this little walk-through of file permissions in Linux. Now that we know what we're looking for, we can talk about changing certain permissions.
As we mentioned at the beginning of this course, the big advantage that Linux has is its multi-user concept- the fact that many different people can use the same computer or that one person can use the same computer to do different jobs. That's where the system of file permissions comes in to help out in what could be a very confusing situation. We're going to explain some basic concepts about who owns the file and who can do what with a file. We won't get into an enormous amount of detail here. We'll save that for the Linux system administration course. We will show you how to understand file permission symbols and how to modify certain files so that they're more secure.
File permission symbols
If you run the command ls -l in your home directory, you will get a list of files that may include something like this
-rw-r--r-- 1 bob users 1892 Jul 10 18:30 linux_course_notes.txt
This basically says, interpreting this from RIGHT to LEFT that the file, linux_course_notes.txt was created at 6:30 PM on July 10 and is 1892 bytes large. It belongs to the group users (i.e, the people who use this computer). It belongs to bob in particular and it is one (1) file. Then come the file permission symbols.
Let's look at what these symbols mean:
* The slash marks - separate the permissions into three types
* The first part refers to the owner's (bob's) permissions.
* The slash mark - before the rw means that this is a normal file that contains any type of data. A directory, for example, would have a d instead of a slash mark.
* The rw that follows means that bob can read and write to (modify) his own file. That's pretty logical. If you own it, you can do what you want with it.
* The second part of the these symbols after the second slash, are the permissions for the group. Linux can establish different types of groups for file access. In a one home computer environment anyone who uses the computer can read this file but cannot write to (modify) it. This is a completely normal situation. You, as a user, may want to take away the rights of others to read your file. We'll cover how to do that later.
* After the two slash marks (two here because there is no write permissions for the group) come the overall user permissions. Anyone who might have access to the computer from inside or outside (in the case of a network) can read this file. Once again, we can take away the possibility of people reading this file if we so choose.
Let's take a look at some other examples. An interesting place to look at different kinds of file permissions is the /bin directory. Here we have the commands that anybody can use on the Linux system. Let's look at the command for gzip, a file compression utility for Linux.
-rwxr-xr-x 1 root root 53468 May 1 1999 gzip
As we see here, there are some differences.
* The program name, date, bytes are all standard. Even though this is obviously different information, the idea is the same as before.
* The changes are in the owner and group. Root owns the file and it is in the group "root". Root is actually the only member of that group.
* The file is an executable (program) so that's why the letter x is among the symbols.
* This file can be executed by everybody: the owner (root), the group (root) and all others that have access to the computer
* As we mentioned, the file is a program, so there is no need for anybody other than root to "write" to the file, so there is no w permissions for it for anybody but root.
If we look at a file in /sbin which are files that only root can use or execute, 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. As we can see here, only root, the owner of the file, is allowed to use this program. There are no x permissions for the rest of the users.
We hope you enjoyed this little walk-through of file permissions in Linux. Now that we know what we're looking for, we can talk about changing certain permissions.
Using 'chown'
The command chown is the chmod's cousin. It is used for changing the ownership rights of a file (hence the name 'chown' - change owner). It does not change the read, write and execution permissions however.
This command, though available to every user, is probably going to be used when you're working as root. The command is uses like this:
chown owner:group the_file
Let's say you want to copy something from your Windows partition (if you have one). You mount the partition (as root) and to save time, you copy the file to your user directory /home/bob/. 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, root is the owner of the file. Therefore, root is the only one who has write permissions for the file (permission to modify its content). If you plan on working with the file as "bob", there isn't a snowball's chance in hell to modify that file until, as root, you run chown on the file. 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. On a network, groups are created according to the needs of the organization. On your single home computer, just type ls -l and see what system corresponds to you.
As you can see, 'chown' is absolutely necessary if you're working as more than one user with the computer.
This command, though available to every user, is probably going to be used when you're working as root. The command is uses like this:
chown owner:group the_file
Let's say you want to copy something from your Windows partition (if you have one). You mount the partition (as root) and to save time, you copy the file to your user directory /home/bob/. 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, root is the owner of the file. Therefore, root is the only one who has write permissions for the file (permission to modify its content). If you plan on working with the file as "bob", there isn't a snowball's chance in hell to modify that file until, as root, you run chown on the file. 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. On a network, groups are created according to the needs of the organization. On your single home computer, just type ls -l and see what system corresponds to you.
As you can see, 'chown' is absolutely necessary if you're working as more than one user with the computer.
Backing up your files
Let's face it, computers aren't perfect. Linux is an "almost perfect" operating system, but things do happen and data is sometimes lost. The best way to avoid problems is to backup your files. Linux provides two key programs to do this: 'tar' and 'gzip'
First we'll start with 'tar'. This program assembles various files into one package, commonly called a "tarball". Let's say you have some files - notes that you've taken during this course. You have:
* notes_1.txt
* notes_2.txt
* notes_3.txt
* notes_4.txt
* notes_5.txt
and you've placed them in a directory called /linux_course. You want to back them up and keep them on a floppy, let's say. You would type the following command to package them in a tarball.
tar -cvf linux_notes.tar notes*.txt
First, you have tar, the name of the program. Then you have the options, c (--create) v (--verbose-show what files they are) (f--file -make a file - should always be the last option) Then you have the name of the file you want to create ( linux_notes.tar) and the files you want to backup (notes*.txt).
This presupposes that you may have other files in the directory that you don't want to include. If you want to include ALL files in a directory, just substitute notes*.txt for *.*.
If you've got good data storage capabilities (Jaz or Zip drives, a CD writer or a tape backup drive), you might want to back up whole directories along with their corresponding subdirectories. Then you would enter in the directory, let's say /home/bob/ and issue the command:
tar -cvf bob_backup.tar *
With one asterisk, you will include directories and files without extensions (my_file as opposed to my_file.txt). Be prepared to get a fairly voluminous tarball.
This is the first step in the backup process. Now let's look at the second step; the compression of these files.
Using 'gzip'
As we mentioned, 'tar' just assembles the files together into only one file. 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'.
gzip is the preferred compression tool for Linux. To reduce the size of your tar file, you would issue the following command:
gzip your_tar_file.tar
and the tar file would be compressed. You can also compress a regular file using the same command, but gzip is used primarily with tarballs.
The result would be a file like this: your_tar_file.tar.gz
The two file extensions show us that the file is a tarball and it is compressed with the 'gzip' format. You can now proceed to store this as you see fit.
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. If you add z to the options, and change the name of the file to create to a .gz extension, you have the whole shebang in one step. Our previous example would be modified to this:
tar -czvf bob_backup.tar.gz *
Remember f should always be the last option.
First we'll start with 'tar'. This program assembles various files into one package, commonly called a "tarball". Let's say you have some files - notes that you've taken during this course. You have:
* notes_1.txt
* notes_2.txt
* notes_3.txt
* notes_4.txt
* notes_5.txt
and you've placed them in a directory called /linux_course. You want to back them up and keep them on a floppy, let's say. You would type the following command to package them in a tarball.
tar -cvf linux_notes.tar notes*.txt
First, you have tar, the name of the program. Then you have the options, c (--create) v (--verbose-show what files they are) (f--file -make a file - should always be the last option) Then you have the name of the file you want to create ( linux_notes.tar) and the files you want to backup (notes*.txt).
This presupposes that you may have other files in the directory that you don't want to include. If you want to include ALL files in a directory, just substitute notes*.txt for *.*.
If you've got good data storage capabilities (Jaz or Zip drives, a CD writer or a tape backup drive), you might want to back up whole directories along with their corresponding subdirectories. Then you would enter in the directory, let's say /home/bob/ and issue the command:
tar -cvf bob_backup.tar *
With one asterisk, you will include directories and files without extensions (my_file as opposed to my_file.txt). Be prepared to get a fairly voluminous tarball.
This is the first step in the backup process. Now let's look at the second step; the compression of these files.
Using 'gzip'
As we mentioned, 'tar' just assembles the files together into only one file. 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'.
gzip is the preferred compression tool for Linux. To reduce the size of your tar file, you would issue the following command:
gzip your_tar_file.tar
and the tar file would be compressed. You can also compress a regular file using the same command, but gzip is used primarily with tarballs.
The result would be a file like this: your_tar_file.tar.gz
The two file extensions show us that the file is a tarball and it is compressed with the 'gzip' format. You can now proceed to store this as you see fit.
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. If you add z to the options, and change the name of the file to create to a .gz extension, you have the whole shebang in one step. Our previous example would be modified to this:
tar -czvf bob_backup.tar.gz *
Remember f should always be the last option.
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.
The easiest way for doing this is to use 'tar' for the whole process. 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, then you've got an old tarball. If you untarred it in the same directory, you'd overwrite the existing ones. If you would like a copy of the old file, untar it in a different directory. If you don't want the old files, then you should make a new tarball. It's pretty standard backup practice.
When you've decided what you want to do, to proceed with the "untarring", issue this command:
tar -zxvpf my_tar_file.tar.gz
I've used my preferred options. I'll explain them:
* -z - unzip the file first
* -x - extract the files from the tarball
* -v - "verbose" (i.e tar tells you what files it's extracting)
* -p - preserves dates, permissions of the original files
* -f - use the file in question (if you don't specify this, tar just sort of sits around doing nothing)
The files are extracted and your original tarball is preserved (my_tar_file.tar.gz).
You can also untar the file and then use gzip separately. Just leave the z option out of the previous example and type:
gzip -d my_tar_file.tar.gz or
gunzip my_tar_file.tar.gz
(gunzip runs gzip -d "automagically"!)
These commands are good if you've just zipped a regular file (not a tarball).
Other compression tools
zip
Most Linux distributions come with other tools to compress files. One of these is zip, famous in the MS-DOS/Windows world. If you're planning on compressing files to give to someone who (still) uses the Windows operating system, this might be your best bet. You can also use unzip if someone gives you a file compressed with 'zip'. Consult the man file ( man zip) for specific instructions on using this tool.
bzip2
There is also another tool that is rapidly gaining acceptance in the Linux world: bzip2. As a matter of fact, the Linux kernel source package, usually comes "bzipped". When you compile a kernel (create a custom kernel for yourself from source) there is an option to create a bzipped kernel. This is supposed to become the official way of doing it in the near future, 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'. The compression factor is supposed to be a little better. There are some differences in options for more advanced users. Consult man bzip2 for more information.
The easiest way for doing this is to use 'tar' for the whole process. 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, then you've got an old tarball. If you untarred it in the same directory, you'd overwrite the existing ones. If you would like a copy of the old file, untar it in a different directory. If you don't want the old files, then you should make a new tarball. It's pretty standard backup practice.
When you've decided what you want to do, to proceed with the "untarring", issue this command:
tar -zxvpf my_tar_file.tar.gz
I've used my preferred options. I'll explain them:
* -z - unzip the file first
* -x - extract the files from the tarball
* -v - "verbose" (i.e tar tells you what files it's extracting)
* -p - preserves dates, permissions of the original files
* -f - use the file in question (if you don't specify this, tar just sort of sits around doing nothing)
The files are extracted and your original tarball is preserved (my_tar_file.tar.gz).
You can also untar the file and then use gzip separately. Just leave the z option out of the previous example and type:
gzip -d my_tar_file.tar.gz or
gunzip my_tar_file.tar.gz
(gunzip runs gzip -d "automagically"!)
These commands are good if you've just zipped a regular file (not a tarball).
Other compression tools
zip
Most Linux distributions come with other tools to compress files. One of these is zip, famous in the MS-DOS/Windows world. If you're planning on compressing files to give to someone who (still) uses the Windows operating system, this might be your best bet. You can also use unzip if someone gives you a file compressed with 'zip'. Consult the man file ( man zip) for specific instructions on using this tool.
bzip2
There is also another tool that is rapidly gaining acceptance in the Linux world: bzip2. As a matter of fact, the Linux kernel source package, usually comes "bzipped". When you compile a kernel (create a custom kernel for yourself from source) there is an option to create a bzipped kernel. This is supposed to become the official way of doing it in the near future, 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'. The compression factor is supposed to be a little better. There are some differences in options for more advanced users. Consult man bzip2 for more information.
Using Linux to access the Internet
We live in an interconnected world. In fact, you're using this interconnectivity in form of the Internet to access this course. Chances are, however, that you're using some other OS to connect to your ISP and read this course. After this lesson, you should be able to connect and browse what's out there in cyberspace using Linux.
On-ramps to the "information superhighway"
I think that the term "information superhighway" is a perfect analogy for the Internet. That's probably why it has become so popular. The superhighway itself is the telephone companies infrastructure - the lines, fiber-optic cables, switches and satellites that bring the hundreds of millions of pages of content to you, including this page. Your computer is like that car on the highway. Your modem or other device that connects you is like the engine of your car. That's why we've written this lesson. If you can't get the engine to work, you're not going anywhere. Linux and other OSes are a bit like the fuel you put in your car. If you have been using Windows, that's like using gasoline. If you switch to Linux, that's different, like jet fuel. You'll have to modify your engine to be able to use it, but you'll go faster in the end.
Types of connections
There are basically three types of connections to the Internet; leased lines, broadband and dial-up connections.
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. These are known as T1 and T3 lines in North America and E class lines in Europe. This course will not deal with setting up and Internet connection with these lines. It's a little out of the scope of your average Linux user.
xDSL (Digital Subscriber Line) and cable modem are what is known as "broadband" connections. These services offer 24 hour high-speed connections to the Internet in most cases (unless you shut off your machine, of course). For example, in my area, I have ADSL service. My connection runs at 250 kilobits per second when I am receiving data. To put it in other terms, I can download a 5 megabyte file (like a song) in about 3-4 minutes. This depends a lot on where you're connecting to and other factors, but broadband is the best alternative for home users. Depending on what company is providing you with this service, you can even use this connection to serve your own personal or small business webpage using Linux as a web server. In the xDSL area, 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. Lately, cable modem is becoming more popular than xDSL, particularly in the United States because the cable companies seem to have gotten on the ball faster to offer consumers high speed connections. With all due respect to telephone companies, there may be, and I suspect there are legitimate technical reasons why a cable connection is essentially cheaper and easier to provide to to consumers. The reasons behind this would go beyond the scope of this lesson, (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.
Dial-up (standard modem) connections are by far the most popular way of connecting to the Internet. Up until the late-1990's, if you weren't a Fortune 500 company, it was the only way to get on the Internet. This connection type basically consists of using a modem to dial the phone and connect to the Internet Service Provider (ISP). The modem "negotiates" the connection (ie - tells the ISP who you are) using a couple of established network protocols. The best speed you can hope to get out of a dial-up connection is 56 kilobits per second. That is to say, about 5 times slower than the slowest broadband connection.
ISDN - a footnote: A few years ago, in my area at least, the telephone company was trying to sell people on ISDN (Integrated Services Digital Network) to solve the two main problems with Internet use, namely the slow modem speed and the fact that you couldn't make or receive phone calls while using the Internet. They promised connections of up to 128 kilobits per second (the key words here being up to, using the tactic of car advertisements that say from 9,599 dollars, but in reverse). This has never seemed to have caught on, at least in my area. The few people who I know who had this service (and later dropped it) complained about the speed. What they promised, just couldn't be delivered. At any rate, nobody seems to be talking about it so much anymore.
Let's move on to the next section where we'll show you how to set up the different Internet connection alternatives under Linux.
On-ramps to the "information superhighway"
I think that the term "information superhighway" is a perfect analogy for the Internet. That's probably why it has become so popular. The superhighway itself is the telephone companies infrastructure - the lines, fiber-optic cables, switches and satellites that bring the hundreds of millions of pages of content to you, including this page. Your computer is like that car on the highway. Your modem or other device that connects you is like the engine of your car. That's why we've written this lesson. If you can't get the engine to work, you're not going anywhere. Linux and other OSes are a bit like the fuel you put in your car. If you have been using Windows, that's like using gasoline. If you switch to Linux, that's different, like jet fuel. You'll have to modify your engine to be able to use it, but you'll go faster in the end.
Types of connections
There are basically three types of connections to the Internet; leased lines, broadband and dial-up connections.
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. These are known as T1 and T3 lines in North America and E class lines in Europe. This course will not deal with setting up and Internet connection with these lines. It's a little out of the scope of your average Linux user.
xDSL (Digital Subscriber Line) and cable modem are what is known as "broadband" connections. These services offer 24 hour high-speed connections to the Internet in most cases (unless you shut off your machine, of course). For example, in my area, I have ADSL service. My connection runs at 250 kilobits per second when I am receiving data. To put it in other terms, I can download a 5 megabyte file (like a song) in about 3-4 minutes. This depends a lot on where you're connecting to and other factors, but broadband is the best alternative for home users. Depending on what company is providing you with this service, you can even use this connection to serve your own personal or small business webpage using Linux as a web server. In the xDSL area, 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. Lately, cable modem is becoming more popular than xDSL, particularly in the United States because the cable companies seem to have gotten on the ball faster to offer consumers high speed connections. With all due respect to telephone companies, there may be, and I suspect there are legitimate technical reasons why a cable connection is essentially cheaper and easier to provide to to consumers. The reasons behind this would go beyond the scope of this lesson, (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.
Dial-up (standard modem) connections are by far the most popular way of connecting to the Internet. Up until the late-1990's, if you weren't a Fortune 500 company, it was the only way to get on the Internet. This connection type basically consists of using a modem to dial the phone and connect to the Internet Service Provider (ISP). The modem "negotiates" the connection (ie - tells the ISP who you are) using a couple of established network protocols. The best speed you can hope to get out of a dial-up connection is 56 kilobits per second. That is to say, about 5 times slower than the slowest broadband connection.
ISDN - a footnote: A few years ago, in my area at least, the telephone company was trying to sell people on ISDN (Integrated Services Digital Network) to solve the two main problems with Internet use, namely the slow modem speed and the fact that you couldn't make or receive phone calls while using the Internet. They promised connections of up to 128 kilobits per second (the key words here being up to, using the tactic of car advertisements that say from 9,599 dollars, but in reverse). This has never seemed to have caught on, at least in my area. The few people who I know who had this service (and later dropped it) complained about the speed. What they promised, just couldn't be delivered. At any rate, nobody seems to be talking about it so much anymore.
Let's move on to the next section where we'll show you how to set up the different Internet connection alternatives under Linux.
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, the vast majority of people in the world, at the time of this writing, connect to the Internet via telephone dial-up through the use of a standard modem, usually at speeds ranging from 14.4 to 56 kilobits per second (kbps). The purpose of this lesson, therefore, is to discuss the way to get a dial-up connection running under Linux.
There are modems and then there are "winmodems"
Once upon a time, there were modems (which still exist) where the ability to use it to connect to computer networks, like the Internet, was based on the configuration of the hardware. Nevertheless, companies like Motorola, Rockwell and others developed modems where the configuration of the device was made possible through software more than the embedded programming on the hardware. This software was exclusively compatible with, yes, you guessed it, Microsoft Windows. They became known as "winmodems". Until recently it was impossible to get one of these little jewels in the MS crown running under Linux. If you happen to have one, you could check out Linmodems.org for more information about installing drivers for these to run under Linux. Motorola recently released a set of drivers for their "winmodems".
The best and easiest way, however, 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. Before I had an ADSL connection, I used an external Dynalink 56 kbps modem. The set-up of this modem under SuSE Linux, Red Hat, Mandrake and Slackware was trivial. Before that I used a 38.8 kbps internal modem and a 28.8 kbps one before that, upgrading as the higher speeds became available and their decreasing prices warranted the change.
External Modems
External modems are called that precisely because you have a little box that sits outside your computer. These connect either via a parallel port or a serial port. A parallel port is one that is normally used to connect a printer. A serial port is similar in appearance to the one that is used to connect your mouse. For example, on my workstation, where I am writing this lesson, there are two serial ports, known as "com1" and "com2". As you can remember from our lessons on other subjects such as hard drives and floppy drives, Linux always knows these devices by other names, files that reside within the /dev/ directory. In our case, Linux knows com1 and com2 as /dev/ttyS0 and /dev/ttyS1 respectively (in the computer world, we usually start counting at zero). If you have a serial mouse, this is usually occupying com1 and therefore /dev/ttyS0. If you then get an external modem and you want to use it, you would hook it up to the second serial port, com2, which, as I mentioned, Linux knows as /dev/ttyS1. 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.
Under SuSE Linux for example, this is quite easy. 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'. 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'll see the various "com" ports available and even, with the newer version of SuSE, USB modem support. If you have a serial mouse, be sure to choose com2 or /dev/ttyS1. You should have your modem set up after you've done this.
If you've installed Red Hat Linux, then you should have no problem setting it up with one of their utilities known as modemtool. If you've installed Mandrake, their tool HardDrake should do the trick. LinuxConf is also an all-purpose tool that includes modem configuration. I have had (and heard of) mixed results with this tool.
Now that you've got a modem connected, we'll talk about configuring your connection with your ISP in the next part of the lesson.
There are modems and then there are "winmodems"
Once upon a time, there were modems (which still exist) where the ability to use it to connect to computer networks, like the Internet, was based on the configuration of the hardware. Nevertheless, companies like Motorola, Rockwell and others developed modems where the configuration of the device was made possible through software more than the embedded programming on the hardware. This software was exclusively compatible with, yes, you guessed it, Microsoft Windows. They became known as "winmodems". Until recently it was impossible to get one of these little jewels in the MS crown running under Linux. If you happen to have one, you could check out Linmodems.org for more information about installing drivers for these to run under Linux. Motorola recently released a set of drivers for their "winmodems".
The best and easiest way, however, 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. Before I had an ADSL connection, I used an external Dynalink 56 kbps modem. The set-up of this modem under SuSE Linux, Red Hat, Mandrake and Slackware was trivial. Before that I used a 38.8 kbps internal modem and a 28.8 kbps one before that, upgrading as the higher speeds became available and their decreasing prices warranted the change.
External Modems
External modems are called that precisely because you have a little box that sits outside your computer. These connect either via a parallel port or a serial port. A parallel port is one that is normally used to connect a printer. A serial port is similar in appearance to the one that is used to connect your mouse. For example, on my workstation, where I am writing this lesson, there are two serial ports, known as "com1" and "com2". As you can remember from our lessons on other subjects such as hard drives and floppy drives, Linux always knows these devices by other names, files that reside within the /dev/ directory. In our case, Linux knows com1 and com2 as /dev/ttyS0 and /dev/ttyS1 respectively (in the computer world, we usually start counting at zero). If you have a serial mouse, this is usually occupying com1 and therefore /dev/ttyS0. If you then get an external modem and you want to use it, you would hook it up to the second serial port, com2, which, as I mentioned, Linux knows as /dev/ttyS1. 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.
Under SuSE Linux for example, this is quite easy. 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'. 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'll see the various "com" ports available and even, with the newer version of SuSE, USB modem support. If you have a serial mouse, be sure to choose com2 or /dev/ttyS1. You should have your modem set up after you've done this.
If you've installed Red Hat Linux, then you should have no problem setting it up with one of their utilities known as modemtool. If you've installed Mandrake, their tool HardDrake should do the trick. LinuxConf is also an all-purpose tool that includes modem configuration. I have had (and heard of) mixed results with this tool.
Now that you've got a modem connected, we'll talk about configuring your connection with your ISP in the next part of the lesson.
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. Most will do the job quite nicely. I have found one in particular that is the easiest of all to use. Not surprisingly that it is called eznet. It was written by Richard Hipp and it makes setting up your Internet connection absolutely trivial. For Red Hat and RPM based distributions there is a RPM package compiled by Kent Robotti and available through RPMfind.net. There is also a "tarball" available at Ibiblio's website If you're feeling adventurous, you might want to go to Dr. Hipp's website and download the C source code and compile it, which is another option.
Basically, 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, (what we covered in the previous section). There is a possibility to handle several different ISPs (at one point, I had 3 different ISPs configured). Once you've answered the questions and you have your connection setup, connection is nothing more than typing one command in a terminal:
eznet up 0
The program starts counting ISPs with the number 0, so that's your first ISP. Just substitute for 1, 2 etc. for other connections you may want to set up.
Other options
If you use YAST in SuSE Linux you can set up your connection using WvDial. I must confess that earlier versions of this program were not entirely successful in setting up my connection. Euphemistically speaking, they couldn't do it. This program has been greatly improved and your probability of success along with it.
If you've picked out your windows manager already and it happens to be KDE, you're in luck because there is a program called KPPP which will set up a connection for you fairly painlessly. The only problem I seemed to have with this was is known as the "negotiation" of the connection with my ISP. There are two protocols known as PAP and CHAP. If you run into this problem, it just might be a question of trying one or the other and sticking with the one that works. With KPPP, you can also tune or tweak your connection speed to get better results from your hardware.
User of Red Hat have a very powerful and simple to use graphic tool with RP3. This is standard issue on all versions of Red Hat since 6.2
For the technically curious
As you'll notice, the program I mentioned for KDE is called KPPP. The K stands for KDE but what does the PPP stand for? It stands for Point-to-Point Protocol. This protocol enables two computers to connect across a network. The protocol basically provides the means for the two computers to first, identify themselves and then ask whether the computers can read the data each other sends. In your /sbin/ directory, you'll find the point-to-point protocol daemon, or pppd which is a program that provides for that communication between computers.
What you essentially do when you set up your Internet connection is to make sure that pppd knows how to communicate the right information. If the two computers either can't authenticate themselves to each other (ie- realize that they have "permission" to communicate) or the type of data their sending is incompatible or both, then the connection fails. What eznet, kppp, RP3 and other similar programs do are to create the necessary configuration files that pppd reads. When I first set up an Internet connection with Linux, I created these files by hand without the help of one of these programs. It was an interesting exercise but essentially took a long time to figure out at those days. If you're interested in finding out what goes on behind the scenes, 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.
A common problem
The most common problem I have come up against is that somehow the very important configuration file /etc/resolv.conf gets overwritten. 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. The symptom of the problem usually is that even though you've connected to your ISP, you're not reaching pages out there. The first thing you should do is make sure /etc/resolve.conf includes the two or more IP addresses of the domain name servers; those machines that translate for example, www.linux.org, into our actual numerical address. As I mentioned in the section on ADSL, it should look something like this:
nameserver 30.30.30.30
nameserver 40.40.40.40
Your numbers will of course be different, but if you don't see at least two lines like this: nameserver plus an IP address, then you'll have to add it again. Then you should find out why and how your distribution is over-writing this file so it doesn't happen again, unless, of course, you want it to. SuSE, for example, has a section in their YAST tool where you can configure it not to overwrite certain files like resolv.conf.
That pretty much sums up setting up dial-up connections. Happy surfing with Linux!
Basically, 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, (what we covered in the previous section). There is a possibility to handle several different ISPs (at one point, I had 3 different ISPs configured). Once you've answered the questions and you have your connection setup, connection is nothing more than typing one command in a terminal:
eznet up 0
The program starts counting ISPs with the number 0, so that's your first ISP. Just substitute for 1, 2 etc. for other connections you may want to set up.
Other options
If you use YAST in SuSE Linux you can set up your connection using WvDial. I must confess that earlier versions of this program were not entirely successful in setting up my connection. Euphemistically speaking, they couldn't do it. This program has been greatly improved and your probability of success along with it.
If you've picked out your windows manager already and it happens to be KDE, you're in luck because there is a program called KPPP which will set up a connection for you fairly painlessly. The only problem I seemed to have with this was is known as the "negotiation" of the connection with my ISP. There are two protocols known as PAP and CHAP. If you run into this problem, it just might be a question of trying one or the other and sticking with the one that works. With KPPP, you can also tune or tweak your connection speed to get better results from your hardware.
User of Red Hat have a very powerful and simple to use graphic tool with RP3. This is standard issue on all versions of Red Hat since 6.2
For the technically curious
As you'll notice, the program I mentioned for KDE is called KPPP. The K stands for KDE but what does the PPP stand for? It stands for Point-to-Point Protocol. This protocol enables two computers to connect across a network. The protocol basically provides the means for the two computers to first, identify themselves and then ask whether the computers can read the data each other sends. In your /sbin/ directory, you'll find the point-to-point protocol daemon, or pppd which is a program that provides for that communication between computers.
What you essentially do when you set up your Internet connection is to make sure that pppd knows how to communicate the right information. If the two computers either can't authenticate themselves to each other (ie- realize that they have "permission" to communicate) or the type of data their sending is incompatible or both, then the connection fails. What eznet, kppp, RP3 and other similar programs do are to create the necessary configuration files that pppd reads. When I first set up an Internet connection with Linux, I created these files by hand without the help of one of these programs. It was an interesting exercise but essentially took a long time to figure out at those days. If you're interested in finding out what goes on behind the scenes, 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.
A common problem
The most common problem I have come up against is that somehow the very important configuration file /etc/resolv.conf gets overwritten. 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. The symptom of the problem usually is that even though you've connected to your ISP, you're not reaching pages out there. The first thing you should do is make sure /etc/resolve.conf includes the two or more IP addresses of the domain name servers; those machines that translate for example, www.linux.org, into our actual numerical address. As I mentioned in the section on ADSL, it should look something like this:
nameserver 30.30.30.30
nameserver 40.40.40.40
Your numbers will of course be different, but if you don't see at least two lines like this: nameserver plus an IP address, then you'll have to add it again. Then you should find out why and how your distribution is over-writing this file so it doesn't happen again, unless, of course, you want it to. SuSE, for example, has a section in their YAST tool where you can configure it not to overwrite certain files like resolv.conf.
That pretty much sums up setting up dial-up connections. Happy surfing with Linux!
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, most people who use computers equate Microsoft with computing. In particular, the only computing environment that most PC users have ever seen comes in the successive versions of their flagship operating system Windows(tm). However, 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, but not the experience itself. Windows has become famous for essentially blurring the reality of what a computer really does. That is to say that Microsoft Windows, especially since the release of Windows 95, has masked any trace of the traditional "black" computer screen experience. It was still there - you just couldn't see it unless you purposely looked for it.
Bill Gates, chairman of the Microsoft Corporation once stated that: "Linux is 1960's technology with a new development model". 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. 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. Then Linux started to gain in popularity and be noticed by a certain segment of the public around 1998-99. The problem was that Linux offered the black screen and the graphic user interface as a separate package. Bill Gates had already established that this was a no-no and so Linux gets chalked up as "retrograde".
Now it's 2002 and Linux still offers the black screen and graphic user interface separately. But then again, a lot has happened since 1998. For one, IBM has spent 1 billion US dollars on Linux and essentially gotten its investment back. Linux's market share continues to rise. It still pales in comparison with Microsoft's desktop popularity - so much so that as most everyone knows, Microsoft was convicted of being a monopoly in restraint of trade. Then again, in 2000 and 2001 successive email viruses and worms crippled Windows-based IT departments and brought scores of corporate networks to a grinding halt. Why? Because we're in a new world of connectivity. Bill Gates' comment about Linux may be turned back now upon his own company. If you asked your average Linux enthusiast what he or she thinks of Windows, you might get this reply: "Windows is pre-Internet technology with a slick new marketing campaign". 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. Windows development model was conceived before everybody's computers where connected to each other and it continues to reflect that. Linux, however, was born on the Internet and grew up with it. Unfortunately, more complaints about Linux's perceived lack of user friendliness outnumber complaints about Windows being essentially a Maginot Line solution for secure computing. Hopefully in this lesson on graphic user interfaces under Linux, you'll get a good idea how the balance between user friendliness and security is a good one with our favorite OS.
As much as I like Linux and think that it is the best operating system out there today, most people who use computers equate Microsoft with computing. In particular, the only computing environment that most PC users have ever seen comes in the successive versions of their flagship operating system Windows(tm). However, 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, but not the experience itself. Windows has become famous for essentially blurring the reality of what a computer really does. That is to say that Microsoft Windows, especially since the release of Windows 95, has masked any trace of the traditional "black" computer screen experience. It was still there - you just couldn't see it unless you purposely looked for it.
Bill Gates, chairman of the Microsoft Corporation once stated that: "Linux is 1960's technology with a new development model". 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. 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. Then Linux started to gain in popularity and be noticed by a certain segment of the public around 1998-99. The problem was that Linux offered the black screen and the graphic user interface as a separate package. Bill Gates had already established that this was a no-no and so Linux gets chalked up as "retrograde".
Now it's 2002 and Linux still offers the black screen and graphic user interface separately. But then again, a lot has happened since 1998. For one, IBM has spent 1 billion US dollars on Linux and essentially gotten its investment back. Linux's market share continues to rise. It still pales in comparison with Microsoft's desktop popularity - so much so that as most everyone knows, Microsoft was convicted of being a monopoly in restraint of trade. Then again, in 2000 and 2001 successive email viruses and worms crippled Windows-based IT departments and brought scores of corporate networks to a grinding halt. Why? Because we're in a new world of connectivity. Bill Gates' comment about Linux may be turned back now upon his own company. If you asked your average Linux enthusiast what he or she thinks of Windows, you might get this reply: "Windows is pre-Internet technology with a slick new marketing campaign". 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. Windows development model was conceived before everybody's computers where connected to each other and it continues to reflect that. Linux, however, was born on the Internet and grew up with it. Unfortunately, more complaints about Linux's perceived lack of user friendliness outnumber complaints about Windows being essentially a Maginot Line solution for secure computing. Hopefully in this lesson on graphic user interfaces under Linux, you'll get a good idea how the balance between user friendliness and security is a good one with our favorite OS.
Internet Browsers
Popular, useful and important programs that run in X-Window
At this point you've chosen your window manager and/or desktop environment. Regardless of the "look" you've chosen, you have to have programs to run. You need applications to surf the Internet, write email, manage your files, 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. There is no major application that a computer user needs that Linux lacks.
Internet/WWW Browsers
Firefox
Firefox is the most popular open source browser. It is available not only for Linux, but for the other major OS platforms. It is based on Mozilla, which is an open source re-write of the famous Netscape Navigator.
Opera
Billed as the "fastest browser", Opera Software of Norway released their first version of Opera for Linux in March of 2000. These early versions were not stable but the company kept working and slowly added features to their Linux versions. Though the Linux version doesn't offer all of the features of their Windows version, it offers most of them. Though an ad-supported version is available free of charge, Opera is a proprietary product and its source code is not freely available.
Konqueror
Konqueror, part of the KDE project, is a file manager and Internet browser wrapped up into one. You can surf the net and manage your files at the same time. With each subsequent version, new, powerful features are added. Since it forms part of KDE, you need to the desktop environment installed to run Konqueror.
Now, let's look at some popular email clients available for Linux
At this point you've chosen your window manager and/or desktop environment. Regardless of the "look" you've chosen, you have to have programs to run. You need applications to surf the Internet, write email, manage your files, 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. There is no major application that a computer user needs that Linux lacks.
Internet/WWW Browsers
Firefox
Firefox is the most popular open source browser. It is available not only for Linux, but for the other major OS platforms. It is based on Mozilla, which is an open source re-write of the famous Netscape Navigator.
Opera
Billed as the "fastest browser", Opera Software of Norway released their first version of Opera for Linux in March of 2000. These early versions were not stable but the company kept working and slowly added features to their Linux versions. Though the Linux version doesn't offer all of the features of their Windows version, it offers most of them. Though an ad-supported version is available free of charge, Opera is a proprietary product and its source code is not freely available.
Konqueror
Konqueror, part of the KDE project, is a file manager and Internet browser wrapped up into one. You can surf the net and manage your files at the same time. With each subsequent version, new, powerful features are added. Since it forms part of KDE, you need to the desktop environment installed to run Konqueror.
Now, let's look at some popular email clients available for Linux
Email clients
The program you use to get, write and send your email is often referred to as a "client". This is to distinguish it from the programs that sit on servers that receive and process emails either sent to or sent from you. 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. Here we'll look at some of the major email clients for Linux.
Evolution
Ximian's Evolution, part of the GNOME desktop project has received a lot of press lately. It is shaping up to be the only serious challenger to Microsoft Outlook's domination of the groupware scene. Seeing that it has all the features of Outlook, sans the virus problem, then you can see why it's getting some notice. If you're looking for a good email client that comes with scheduling tools, task management, address books and all those things that the busy yet organized person needs, than Ximian is probably the thing for you.
Kmail
Kmail is KDE's major email client. It is not a complete groupware solution like Ximian's Evolution, but its email management capabilities are very powerful. There is support for all major types of email transport, intricate configuration of mail filters, complete support for HTML formatted mail and other useful features.
Sylpheed
Japanese developer Hiroyuki Yamamoto has developed this fast, easy to use full-featured email client. 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. If you have to respond to mail in different capacities (boss, friend, worker), Sylpheed offers the tools to do this all in one client.
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. This one just sucks less.. This was said by Michael Elkins, who developed this email client. A lot of people will probably point out, and rightly so, that Mutt doesn't have a graphic user interface. That is true. However, this client is so popular in the Linux world that I just had to include it here. If you are a newcomer to Linux, you may not want to use Mutt just yet. Using it efficiently requires a well-written .muttrc file. This is the main configuration file that determines how Mutt is going to work. However, if you get used to Mutt, you are probably not going to ever switch. It's lack of a pretty interface is more than made up for by the ability you have to configure Mutt. After you have some months behind you working with it, emails will practically write themselves. If you handle a lot of email, this is the client you probably want to at least look into.
Evolution
Ximian's Evolution, part of the GNOME desktop project has received a lot of press lately. It is shaping up to be the only serious challenger to Microsoft Outlook's domination of the groupware scene. Seeing that it has all the features of Outlook, sans the virus problem, then you can see why it's getting some notice. If you're looking for a good email client that comes with scheduling tools, task management, address books and all those things that the busy yet organized person needs, than Ximian is probably the thing for you.
Kmail
Kmail is KDE's major email client. It is not a complete groupware solution like Ximian's Evolution, but its email management capabilities are very powerful. There is support for all major types of email transport, intricate configuration of mail filters, complete support for HTML formatted mail and other useful features.
Sylpheed
Japanese developer Hiroyuki Yamamoto has developed this fast, easy to use full-featured email client. 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. If you have to respond to mail in different capacities (boss, friend, worker), Sylpheed offers the tools to do this all in one client.
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. This one just sucks less.. This was said by Michael Elkins, who developed this email client. A lot of people will probably point out, and rightly so, that Mutt doesn't have a graphic user interface. That is true. However, this client is so popular in the Linux world that I just had to include it here. If you are a newcomer to Linux, you may not want to use Mutt just yet. Using it efficiently requires a well-written .muttrc file. This is the main configuration file that determines how Mutt is going to work. However, if you get used to Mutt, you are probably not going to ever switch. It's lack of a pretty interface is more than made up for by the ability you have to configure Mutt. After you have some months behind you working with it, emails will practically write themselves. If you handle a lot of email, this is the client you probably want to at least look into.
Office suites, word processors and spreadsheets
StarOffice
StarOffice is a complete, full-featured office suite on the idea of Microsoft Office. It comes complete with word processor (of course), spreadsheet, database interfacing, presentation software plus it offers web browsing and email and a few other features. Originally developed by StarDivision, StarOffice was acquired by Sun Microsystems in 1999. The current stable version of this suite is 5.2 at the time of this writing. However, Sun has announced that they plan to charge for downloads of StarOffice version 6.
KOffice
KOffice is the KDE Project's offering for desktop productivity. It includes all of the standard office suite applications. The software is offered free of charge.
VistaSource's Anywhere Desktop for Linux
This suite was formerly known as ApplixWare. Once again, all the standard office suite tool are offered here. This one boasts a Microsoft Office look and feel. This is not a free product. It cost 99 US dollars at the time of this writing.
Siag Office
Don't let a name like Pathetic Writer dissuade you from checking out this office suite for Linux. The word processor part of the suite can open Microsoft Word format (*.doc) files. The project started with the Scheme in a grid spreadsheet. Now you know why it's called Siag. Another free offering in the office category.
HancomOffice for Linux
Hancom Linux of Korea has developed this commercial full-featured office suite for Linux. Provides compatibility with Microsoft Office formats and smooth integrating into the KDE desktop. An evaluation version is available for download, but the software must be purchased in order to continue to use it.
GNOME Office
GNOME office should actually appear in quotes, because this is not an office suite in the classic sense, but a set of applications that are often associated with office suites, as a package deal, so to speak. Some of the high-lights include:
* Gnumeric, a spreadsheet application
* AbiWord, a word processor (it even runs under Windows and MacOS)
* Gnucash, a personal finance manager
* GNOME-DB, database connectivity software
If you download the Ximian Desktop, you'll get these applications plus the other productivity tools associated with the GNOME project.
StarOffice is a complete, full-featured office suite on the idea of Microsoft Office. It comes complete with word processor (of course), spreadsheet, database interfacing, presentation software plus it offers web browsing and email and a few other features. Originally developed by StarDivision, StarOffice was acquired by Sun Microsystems in 1999. The current stable version of this suite is 5.2 at the time of this writing. However, Sun has announced that they plan to charge for downloads of StarOffice version 6.
KOffice
KOffice is the KDE Project's offering for desktop productivity. It includes all of the standard office suite applications. The software is offered free of charge.
VistaSource's Anywhere Desktop for Linux
This suite was formerly known as ApplixWare. Once again, all the standard office suite tool are offered here. This one boasts a Microsoft Office look and feel. This is not a free product. It cost 99 US dollars at the time of this writing.
Siag Office
Don't let a name like Pathetic Writer dissuade you from checking out this office suite for Linux. The word processor part of the suite can open Microsoft Word format (*.doc) files. The project started with the Scheme in a grid spreadsheet. Now you know why it's called Siag. Another free offering in the office category.
HancomOffice for Linux
Hancom Linux of Korea has developed this commercial full-featured office suite for Linux. Provides compatibility with Microsoft Office formats and smooth integrating into the KDE desktop. An evaluation version is available for download, but the software must be purchased in order to continue to use it.
GNOME Office
GNOME office should actually appear in quotes, because this is not an office suite in the classic sense, but a set of applications that are often associated with office suites, as a package deal, so to speak. Some of the high-lights include:
* Gnumeric, a spreadsheet application
* AbiWord, a word processor (it even runs under Windows and MacOS)
* Gnucash, a personal finance manager
* GNOME-DB, database connectivity software
If you download the Ximian Desktop, you'll get these applications plus the other productivity tools associated with the GNOME project.
Little goodies to improve your quality of life
Music
When I got broadband Internet access, my life changed forever. No more paying for dial-ups on a hourly basis. No more painful downloads of software. But what's more important than all of this is that I could now listen to radio! So what, you say. Well, I live more than 6,000 miles from the place where I grew up, 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, I was delighted. RealAudio player for Linux is just one of those little apps I'd rather not live without.
RealPlayer
I can't help but make an editorial comment here about this application. 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. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. It looks like Gates and Co. plans on dominating the on-line music/information industry. Real Networks is at this point the only thing preventing them from doing it.
Now that I've finished my editorializing, you can go get RealPlayer for Linux and install it and start listening to web broadcasts.
XMMS
XMMS stands for the X multi-media system. If you're familiar with WinAmp, you'll have no trouble getting used to this program. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format.
Image viewing and editing
The GIMP
GIMP stands for GNU Image Manipulation Program. It should never be associated with the English word meaning lame. Gimp also has another meaning, according to the dictionary I consulted: Smart; spruce; trim; nice. That's a better description. This is a full fledged image creating and re-touching application. You can apply all sorts of filters and even write scripts for doing things to the images automatically. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics, then check out The GIMP. You'll be pleasantly surprised.
xv
In the words of the its author, John Bradley, xv doesn't stand for anything. I use this program all the time, literally. It is what I use to display the image in my desktop window.
type this:
xv -root -max -quit your_favorite_pic.jpg
and xv will display your favorite picture as the pic on your desktop. Sometimes I get bored and I use this script to rotate my favorite pictures.
#!/bin/sh
for i in `ls /home/mike/rotation_bkg/*.jpg`
do
xv -root -max -quit $i
sleep 300
done
If you're looking for heavy duty image software, xv is not it, however. This is the author's own words:
Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.
That pretty much sums it up. xv is distributed as shareware.
ImageMagick
ImageMagick is a suite of tools for displaying and manipulating images. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. I use it for three basic things. The 'display' tool I use to tell my email client open images that people send me in emails. Another one I use a lot is the thumbnail generator. 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, then you would type:
display 'vid:*.jpg'
This creates one image of all of the jpg images as thumbnails in the directory you're in. This takes up a lot of CPU power on even a fairly powerful machine, so be patient. If you've got a lot of images in a directory and a slow machine, you might want to consider doing them in small batches.
This next use of ImageMagick is my two-year-old's favorite. I have some pictures of him in a directory and I type:
animate *.jpg
This starts up a slide show of him at blinding speed and he gets a big kick out of it. If you want to get the images rotating at a more manageable speed, just use the shift > keys or click with the right mouse button to call up the menu.
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. If you wanted, for example, to modify my image rotation script above, you would open up a text editor. There are two that I use on two different occasions.
Emacs
There is a version of Emacs if your not using X-window and then there's XEmacs, a version expressly written for X-window. I refer to the x-window version of Emacs, which is like the console version, but has clickable menus and windows and everything you need to work in a graphical environment. Richard Stallman, founder of the GNU project, first started working on Emacs in 1974. It has since then become the flagship application of the GNU project. It is truly the perfect application to be the one associated with the GNU. It is a Swiss Army Knife of editors. To call it an 'editor' is to insult it somewhat. It does a little bit of everything. To me, it's almost like a mini-operating system in and of itself. If you're a programmer, Emacs is essential for working. If I could not use Emacs for some reason, I would probably go off and herd sheep. (and if you think I'm joking, ask my wife). Even for non-programming tasks I use it. The entire Linux Online beginners' course (yes, the words you are reading right now) were written in their entirety using Emacs. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history.
xedit
xedit is a basic text viewer/editor for X-window. It was one of the first applications. It is not slick or fancy, but there is one thing I like very much about it. The ability to fire it up from an xterm with a couple of preferences of mine. Reading fairly long things on a computer is not one of my favorite activities. My eyes don't seem to like it either. With xedit, you can specify a readable font and some good eye-friendly colors when you start it up.
xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file.txt &
As we're on the topic of basic X-Window applications, you can use xcolors to get a background and foreground combination that suits your eyes. Use the right mouse button to select a font color and the middle button to select the background.
If you want to select colors (for example, for web page work) and you've got the GNOME desktop installed, you can use GNOME Color Browser. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names.
Miscellaneous Programs
root-tail
tail is a console application that is normally used for monitoring files that change constantly, like log files. root-tail can be used to display these files on your desktop while you're running X-window. I normally use this to remember important stuff. It really comes in handy. First, you should create a text file with your favorite editor. Call it 'reminders'. Then on each line, write something that you want to remember. Then, you run root-tail. It's best to do this with a few options. For example, 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. First, after '-color' you should use the name of the color you want the text to appear in. Use xcolors to find a color you like that's supported by your system. The next one is '-font'. As you see, I've chosen a good sized one. '-shade' will give the text a little shade under it and will look snazzier. '-g' stands for 'geometry' or the location in the window. I use +10+100 which set it right in front of me. You can experiment with settings. 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. You can keep track of you memory usage, swap space, how much bandwidth you're using through your ethernet card and much, much more. You can see it in this screenshot. It's running on the upper right side of my desktop. It's useful as a way to alert you to how many clueless Windows users there are. Invariably, when some Sircam provoked mail comes through, the 'eth0' monitor, which checks bandwidth usage will start rising for no apparent reason. If you do conversions of audio to MP3 or Ogg format, you can watch your CPU usage go off the scale when you do them. Place your mouse over gkrellm and press F1 to configure other monitors. There are also plug-ins and themes/skins available.
Xchat
xchat is a comfortable IRC (Internet Relay Chat) client. It's very easy to configure to your liking. There is the possibility to use Python and Perl scripts to automate some things you do.
When I got broadband Internet access, my life changed forever. No more paying for dial-ups on a hourly basis. No more painful downloads of software. But what's more important than all of this is that I could now listen to radio! So what, you say. Well, I live more than 6,000 miles from the place where I grew up, 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, I was delighted. RealAudio player for Linux is just one of those little apps I'd rather not live without.
RealPlayer
I can't help but make an editorial comment here about this application. 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. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. It looks like Gates and Co. plans on dominating the on-line music/information industry. Real Networks is at this point the only thing preventing them from doing it.
Now that I've finished my editorializing, you can go get RealPlayer for Linux and install it and start listening to web broadcasts.
XMMS
XMMS stands for the X multi-media system. If you're familiar with WinAmp, you'll have no trouble getting used to this program. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format.
Image viewing and editing
The GIMP
GIMP stands for GNU Image Manipulation Program. It should never be associated with the English word meaning lame. Gimp also has another meaning, according to the dictionary I consulted: Smart; spruce; trim; nice. That's a better description. This is a full fledged image creating and re-touching application. You can apply all sorts of filters and even write scripts for doing things to the images automatically. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics, then check out The GIMP. You'll be pleasantly surprised.
xv
In the words of the its author, John Bradley, xv doesn't stand for anything. I use this program all the time, literally. It is what I use to display the image in my desktop window.
type this:
xv -root -max -quit your_favorite_pic.jpg
and xv will display your favorite picture as the pic on your desktop. Sometimes I get bored and I use this script to rotate my favorite pictures.
#!/bin/sh
for i in `ls /home/mike/rotation_bkg/*.jpg`
do
xv -root -max -quit $i
sleep 300
done
If you're looking for heavy duty image software, xv is not it, however. This is the author's own words:
Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.
That pretty much sums it up. xv is distributed as shareware.
ImageMagick
ImageMagick is a suite of tools for displaying and manipulating images. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. I use it for three basic things. The 'display' tool I use to tell my email client open images that people send me in emails. Another one I use a lot is the thumbnail generator. 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, then you would type:
display 'vid:*.jpg'
This creates one image of all of the jpg images as thumbnails in the directory you're in. This takes up a lot of CPU power on even a fairly powerful machine, so be patient. If you've got a lot of images in a directory and a slow machine, you might want to consider doing them in small batches.
This next use of ImageMagick is my two-year-old's favorite. I have some pictures of him in a directory and I type:
animate *.jpg
This starts up a slide show of him at blinding speed and he gets a big kick out of it. If you want to get the images rotating at a more manageable speed, just use the shift > keys or click with the right mouse button to call up the menu.
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. If you wanted, for example, to modify my image rotation script above, you would open up a text editor. There are two that I use on two different occasions.
Emacs
There is a version of Emacs if your not using X-window and then there's XEmacs, a version expressly written for X-window. I refer to the x-window version of Emacs, which is like the console version, but has clickable menus and windows and everything you need to work in a graphical environment. Richard Stallman, founder of the GNU project, first started working on Emacs in 1974. It has since then become the flagship application of the GNU project. It is truly the perfect application to be the one associated with the GNU. It is a Swiss Army Knife of editors. To call it an 'editor' is to insult it somewhat. It does a little bit of everything. To me, it's almost like a mini-operating system in and of itself. If you're a programmer, Emacs is essential for working. If I could not use Emacs for some reason, I would probably go off and herd sheep. (and if you think I'm joking, ask my wife). Even for non-programming tasks I use it. The entire Linux Online beginners' course (yes, the words you are reading right now) were written in their entirety using Emacs. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history.
xedit
xedit is a basic text viewer/editor for X-window. It was one of the first applications. It is not slick or fancy, but there is one thing I like very much about it. The ability to fire it up from an xterm with a couple of preferences of mine. Reading fairly long things on a computer is not one of my favorite activities. My eyes don't seem to like it either. With xedit, you can specify a readable font and some good eye-friendly colors when you start it up.
xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file.txt &
As we're on the topic of basic X-Window applications, you can use xcolors to get a background and foreground combination that suits your eyes. Use the right mouse button to select a font color and the middle button to select the background.
If you want to select colors (for example, for web page work) and you've got the GNOME desktop installed, you can use GNOME Color Browser. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names.
Miscellaneous Programs
root-tail
tail is a console application that is normally used for monitoring files that change constantly, like log files. root-tail can be used to display these files on your desktop while you're running X-window. I normally use this to remember important stuff. It really comes in handy. First, you should create a text file with your favorite editor. Call it 'reminders'. Then on each line, write something that you want to remember. Then, you run root-tail. It's best to do this with a few options. For example, 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. First, after '-color' you should use the name of the color you want the text to appear in. Use xcolors to find a color you like that's supported by your system. The next one is '-font'. As you see, I've chosen a good sized one. '-shade' will give the text a little shade under it and will look snazzier. '-g' stands for 'geometry' or the location in the window. I use +10+100 which set it right in front of me. You can experiment with settings. 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. You can keep track of you memory usage, swap space, how much bandwidth you're using through your ethernet card and much, much more. You can see it in this screenshot. It's running on the upper right side of my desktop. It's useful as a way to alert you to how many clueless Windows users there are. Invariably, when some Sircam provoked mail comes through, the 'eth0' monitor, which checks bandwidth usage will start rising for no apparent reason. If you do conversions of audio to MP3 or Ogg format, you can watch your CPU usage go off the scale when you do them. Place your mouse over gkrellm and press F1 to configure other monitors. There are also plug-ins and themes/skins available.
Xchat
xchat is a comfortable IRC (Internet Relay Chat) client. It's very easy to configure to your liking. There is the possibility to use Python and Perl scripts to automate some things you do.
Little goodies to improve your quality of life
Music
When I got broadband Internet access, my life changed forever. No more paying for dial-ups on a hourly basis. No more painful downloads of software. But what's more important than all of this is that I could now listen to radio! So what, you say. Well, I live more than 6,000 miles from the place where I grew up, 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, I was delighted. RealAudio player for Linux is just one of those little apps I'd rather not live without.
RealPlayer
I can't help but make an editorial comment here about this application. 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. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. It looks like Gates and Co. plans on dominating the on-line music/information industry. Real Networks is at this point the only thing preventing them from doing it.
Now that I've finished my editorializing, you can go get RealPlayer for Linux and install it and start listening to web broadcasts.
XMMS
XMMS stands for the X multi-media system. If you're familiar with WinAmp, you'll have no trouble getting used to this program. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format.
Image viewing and editing
The GIMP
GIMP stands for GNU Image Manipulation Program. It should never be associated with the English word meaning lame. Gimp also has another meaning, according to the dictionary I consulted: Smart; spruce; trim; nice. That's a better description. This is a full fledged image creating and re-touching application. You can apply all sorts of filters and even write scripts for doing things to the images automatically. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics, then check out The GIMP. You'll be pleasantly surprised.
xv
In the words of the its author, John Bradley, xv doesn't stand for anything. I use this program all the time, literally. It is what I use to display the image in my desktop window.
type this:
xv -root -max -quit your_favorite_pic.jpg
and xv will display your favorite picture as the pic on your desktop. Sometimes I get bored and I use this script to rotate my favorite pictures.
#!/bin/sh
for i in `ls /home/mike/rotation_bkg/*.jpg`
do
xv -root -max -quit $i
sleep 300
done
If you're looking for heavy duty image software, xv is not it, however. This is the author's own words:
Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.
That pretty much sums it up. xv is distributed as shareware.
ImageMagick
ImageMagick is a suite of tools for displaying and manipulating images. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. I use it for three basic things. The 'display' tool I use to tell my email client open images that people send me in emails. Another one I use a lot is the thumbnail generator. 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, then you would type:
display 'vid:*.jpg'
This creates one image of all of the jpg images as thumbnails in the directory you're in. This takes up a lot of CPU power on even a fairly powerful machine, so be patient. If you've got a lot of images in a directory and a slow machine, you might want to consider doing them in small batches.
This next use of ImageMagick is my two-year-old's favorite. I have some pictures of him in a directory and I type:
animate *.jpg
This starts up a slide show of him at blinding speed and he gets a big kick out of it. If you want to get the images rotating at a more manageable speed, just use the shift > keys or click with the right mouse button to call up the menu.
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. If you wanted, for example, to modify my image rotation script above, you would open up a text editor. There are two that I use on two different occasions.
Emacs
There is a version of Emacs if your not using X-window and then there's XEmacs, a version expressly written for X-window. I refer to the x-window version of Emacs, which is like the console version, but has clickable menus and windows and everything you need to work in a graphical environment. Richard Stallman, founder of the GNU project, first started working on Emacs in 1974. It has since then become the flagship application of the GNU project. It is truly the perfect application to be the one associated with the GNU. It is a Swiss Army Knife of editors. To call it an 'editor' is to insult it somewhat. It does a little bit of everything. To me, it's almost like a mini-operating system in and of itself. If you're a programmer, Emacs is essential for working. If I could not use Emacs for some reason, I would probably go off and herd sheep. (and if you think I'm joking, ask my wife). Even for non-programming tasks I use it. The entire Linux Online beginners' course (yes, the words you are reading right now) were written in their entirety using Emacs. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history.
xedit
xedit is a basic text viewer/editor for X-window. It was one of the first applications. It is not slick or fancy, but there is one thing I like very much about it. The ability to fire it up from an xterm with a couple of preferences of mine. Reading fairly long things on a computer is not one of my favorite activities. My eyes don't seem to like it either. With xedit, you can specify a readable font and some good eye-friendly colors when you start it up.
xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file.txt &
As we're on the topic of basic X-Window applications, you can use xcolors to get a background and foreground combination that suits your eyes. Use the right mouse button to select a font color and the middle button to select the background.
If you want to select colors (for example, for web page work) and you've got the GNOME desktop installed, you can use GNOME Color Browser. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names.
Miscellaneous Programs
root-tail
tail is a console application that is normally used for monitoring files that change constantly, like log files. root-tail can be used to display these files on your desktop while you're running X-window. I normally use this to remember important stuff. It really comes in handy. First, you should create a text file with your favorite editor. Call it 'reminders'. Then on each line, write something that you want to remember. Then, you run root-tail. It's best to do this with a few options. For example, 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. First, after '-color' you should use the name of the color you want the text to appear in. Use xcolors to find a color you like that's supported by your system. The next one is '-font'. As you see, I've chosen a good sized one. '-shade' will give the text a little shade under it and will look snazzier. '-g' stands for 'geometry' or the location in the window. I use +10+100 which set it right in front of me. You can experiment with settings. 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. You can keep track of you memory usage, swap space, how much bandwidth you're using through your ethernet card and much, much more. You can see it in this screenshot. It's running on the upper right side of my desktop. It's useful as a way to alert you to how many clueless Windows users there are. Invariably, when some Sircam provoked mail comes through, the 'eth0' monitor, which checks bandwidth usage will start rising for no apparent reason. If you do conversions of audio to MP3 or Ogg format, you can watch your CPU usage go off the scale when you do them. Place your mouse over gkrellm and press F1 to configure other monitors. There are also plug-ins and themes/skins available.
Xchat
xchat is a comfortable IRC (Internet Relay Chat) client. It's very easy to configure to your liking. There is the possibility to use Python and Perl scripts to automate some things you do.
When I got broadband Internet access, my life changed forever. No more paying for dial-ups on a hourly basis. No more painful downloads of software. But what's more important than all of this is that I could now listen to radio! So what, you say. Well, I live more than 6,000 miles from the place where I grew up, 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, I was delighted. RealAudio player for Linux is just one of those little apps I'd rather not live without.
RealPlayer
I can't help but make an editorial comment here about this application. 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. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. It looks like Gates and Co. plans on dominating the on-line music/information industry. Real Networks is at this point the only thing preventing them from doing it.
Now that I've finished my editorializing, you can go get RealPlayer for Linux and install it and start listening to web broadcasts.
XMMS
XMMS stands for the X multi-media system. If you're familiar with WinAmp, you'll have no trouble getting used to this program. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format.
Image viewing and editing
The GIMP
GIMP stands for GNU Image Manipulation Program. It should never be associated with the English word meaning lame. Gimp also has another meaning, according to the dictionary I consulted: Smart; spruce; trim; nice. That's a better description. This is a full fledged image creating and re-touching application. You can apply all sorts of filters and even write scripts for doing things to the images automatically. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics, then check out The GIMP. You'll be pleasantly surprised.
xv
In the words of the its author, John Bradley, xv doesn't stand for anything. I use this program all the time, literally. It is what I use to display the image in my desktop window.
type this:
xv -root -max -quit your_favorite_pic.jpg
and xv will display your favorite picture as the pic on your desktop. Sometimes I get bored and I use this script to rotate my favorite pictures.
#!/bin/sh
for i in `ls /home/mike/rotation_bkg/*.jpg`
do
xv -root -max -quit $i
sleep 300
done
If you're looking for heavy duty image software, xv is not it, however. This is the author's own words:
Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.
That pretty much sums it up. xv is distributed as shareware.
ImageMagick
ImageMagick is a suite of tools for displaying and manipulating images. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. I use it for three basic things. The 'display' tool I use to tell my email client open images that people send me in emails. Another one I use a lot is the thumbnail generator. 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, then you would type:
display 'vid:*.jpg'
This creates one image of all of the jpg images as thumbnails in the directory you're in. This takes up a lot of CPU power on even a fairly powerful machine, so be patient. If you've got a lot of images in a directory and a slow machine, you might want to consider doing them in small batches.
This next use of ImageMagick is my two-year-old's favorite. I have some pictures of him in a directory and I type:
animate *.jpg
This starts up a slide show of him at blinding speed and he gets a big kick out of it. If you want to get the images rotating at a more manageable speed, just use the shift > keys or click with the right mouse button to call up the menu.
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. If you wanted, for example, to modify my image rotation script above, you would open up a text editor. There are two that I use on two different occasions.
Emacs
There is a version of Emacs if your not using X-window and then there's XEmacs, a version expressly written for X-window. I refer to the x-window version of Emacs, which is like the console version, but has clickable menus and windows and everything you need to work in a graphical environment. Richard Stallman, founder of the GNU project, first started working on Emacs in 1974. It has since then become the flagship application of the GNU project. It is truly the perfect application to be the one associated with the GNU. It is a Swiss Army Knife of editors. To call it an 'editor' is to insult it somewhat. It does a little bit of everything. To me, it's almost like a mini-operating system in and of itself. If you're a programmer, Emacs is essential for working. If I could not use Emacs for some reason, I would probably go off and herd sheep. (and if you think I'm joking, ask my wife). Even for non-programming tasks I use it. The entire Linux Online beginners' course (yes, the words you are reading right now) were written in their entirety using Emacs. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history.
xedit
xedit is a basic text viewer/editor for X-window. It was one of the first applications. It is not slick or fancy, but there is one thing I like very much about it. The ability to fire it up from an xterm with a couple of preferences of mine. Reading fairly long things on a computer is not one of my favorite activities. My eyes don't seem to like it either. With xedit, you can specify a readable font and some good eye-friendly colors when you start it up.
xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file.txt &
As we're on the topic of basic X-Window applications, you can use xcolors to get a background and foreground combination that suits your eyes. Use the right mouse button to select a font color and the middle button to select the background.
If you want to select colors (for example, for web page work) and you've got the GNOME desktop installed, you can use GNOME Color Browser. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names.
Miscellaneous Programs
root-tail
tail is a console application that is normally used for monitoring files that change constantly, like log files. root-tail can be used to display these files on your desktop while you're running X-window. I normally use this to remember important stuff. It really comes in handy. First, you should create a text file with your favorite editor. Call it 'reminders'. Then on each line, write something that you want to remember. Then, you run root-tail. It's best to do this with a few options. For example, 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. First, after '-color' you should use the name of the color you want the text to appear in. Use xcolors to find a color you like that's supported by your system. The next one is '-font'. As you see, I've chosen a good sized one. '-shade' will give the text a little shade under it and will look snazzier. '-g' stands for 'geometry' or the location in the window. I use +10+100 which set it right in front of me. You can experiment with settings. 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. You can keep track of you memory usage, swap space, how much bandwidth you're using through your ethernet card and much, much more. You can see it in this screenshot. It's running on the upper right side of my desktop. It's useful as a way to alert you to how many clueless Windows users there are. Invariably, when some Sircam provoked mail comes through, the 'eth0' monitor, which checks bandwidth usage will start rising for no apparent reason. If you do conversions of audio to MP3 or Ogg format, you can watch your CPU usage go off the scale when you do them. Place your mouse over gkrellm and press F1 to configure other monitors. There are also plug-ins and themes/skins available.
Xchat
xchat is a comfortable IRC (Internet Relay Chat) client. It's very easy to configure to your liking. There is the possibility to use Python and Perl scripts to automate some things you do.
Tips and Tricks for X-Window
.xinitrc
This is a file you'll find in your user directory. You can use it to start programs automatically when you start X-window. Open the file with vi or the text editor of your choosing. Then, for example, add:
xclock -bg wheat -geometry 100x100+1+1 &
-bg sets the background color and the -geometry setting I have used here gives you a fairly small, but not too small clock in the upper left hand corner of your desktop. You can type: man xclock to see more options. Experiment with options first before you put your definitive xclock settings in your .xinitrc file. Just type your settings into an xterm and try different ones. Type: killall xclock to shut off the clock each time.
.Xdefaults file
There's another file in your user directory called .Xdefaults. You can use this file to change the way some of your X-window applications look. It's fun to try out different styles and get some settings that please your eye. Before you try to do this however, make a backup. Type:
cp .Xdefaults .Xdefaults_good
because there is always some danger of making some applications non-operable because you have left spaces where you shouldn't. It is important when you change settings that you leave no trailing spaces. Most major distributions provide a working .Xdefaults file. It's best to leave what you find there, but you're free to add stuff to it.
As an example, let's change the look of emacs, for example.
First, open up the file with Vi or any text editor your prefer. Add this to it:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! emacs changes [date]
emacs*Background: DarkCyan
emacs*Foreground: Khaki
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Let's explain what we've done here. First, the exclamation point (!) in this file is used to make comments. The two rows of exclamation points I've used to show where my emacs section begins and ends. 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. You don't have to do this. It's just something extra to remind me when I made the changes. Then we make the actual changes.
With: emacs*background: DarkCyan we can change the background of the application's menu bar and frame. You can use any color you like that the system supports.
With: emacs*Foreground: Khaki we've changed the color of the words in the menu.
To make the changes take effect, you have to issue this command in an xterm:
xrdb -merge $HOME/.Xdefaults
This will restart the x-server database and log in your changes. If you don't do this, X-window keeps your old .Xdefaults in memory and you won't see anything new. Restart emacs and you should see your new colors. If emacs doesn't come up, you may have left some trailing white space. If that is the case, just type emacs in an xterm and an error message should appear saying something like: Warning: Color name "khaki " is not defined or similar. If you see a space before the second quotation mark, then you've got whitespace in your .Xdefaults file that needs to be eliminated.
As you get more adept at changing things, you'll make your desktop more to your liking.
xwininfo
If you're interested in seeing a bit of information about certain programs running, you can type xwininfo into a terminal and then click on any window. For example, 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 .xinitrc file.
xset
This is a command line utility to control things like your mouse, keyboard, monitor and pc speaker. Both GNOME and KDE have other graphic apps to do this stuff a lot easier, so I find myself using this less and less. But you can try it out. For example, type: xset b off to stop your computer from beeping at it. And to turn it back on? You guessed it: xset b on. You can also change the tone by typing something like: xset b 30 550 300 The first number is for volume, the second pitch and the third duration of the beep.
xsetroot
In a previous section, we told you how to use xv to put your favorite picture on your desktop. If you get tired of pictures and you want something plain, you can use xsetroot to just put a color scheme on the desktop. For example, typing: xsetroot -solid seagreen will get you a solid dark green color as a background. This one is soothing to the eyes. It's the same color used on pool and card tables. Of course, you're free to use the color you like! Type: man xsetroot to see other options.
This is a file you'll find in your user directory. You can use it to start programs automatically when you start X-window. Open the file with vi or the text editor of your choosing. Then, for example, add:
xclock -bg wheat -geometry 100x100+1+1 &
-bg sets the background color and the -geometry setting I have used here gives you a fairly small, but not too small clock in the upper left hand corner of your desktop. You can type: man xclock to see more options. Experiment with options first before you put your definitive xclock settings in your .xinitrc file. Just type your settings into an xterm and try different ones. Type: killall xclock to shut off the clock each time.
.Xdefaults file
There's another file in your user directory called .Xdefaults. You can use this file to change the way some of your X-window applications look. It's fun to try out different styles and get some settings that please your eye. Before you try to do this however, make a backup. Type:
cp .Xdefaults .Xdefaults_good
because there is always some danger of making some applications non-operable because you have left spaces where you shouldn't. It is important when you change settings that you leave no trailing spaces. Most major distributions provide a working .Xdefaults file. It's best to leave what you find there, but you're free to add stuff to it.
As an example, let's change the look of emacs, for example.
First, open up the file with Vi or any text editor your prefer. Add this to it:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! emacs changes [date]
emacs*Background: DarkCyan
emacs*Foreground: Khaki
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Let's explain what we've done here. First, the exclamation point (!) in this file is used to make comments. The two rows of exclamation points I've used to show where my emacs section begins and ends. 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. You don't have to do this. It's just something extra to remind me when I made the changes. Then we make the actual changes.
With: emacs*background: DarkCyan we can change the background of the application's menu bar and frame. You can use any color you like that the system supports.
With: emacs*Foreground: Khaki we've changed the color of the words in the menu.
To make the changes take effect, you have to issue this command in an xterm:
xrdb -merge $HOME/.Xdefaults
This will restart the x-server database and log in your changes. If you don't do this, X-window keeps your old .Xdefaults in memory and you won't see anything new. Restart emacs and you should see your new colors. If emacs doesn't come up, you may have left some trailing white space. If that is the case, just type emacs in an xterm and an error message should appear saying something like: Warning: Color name "khaki " is not defined or similar. If you see a space before the second quotation mark, then you've got whitespace in your .Xdefaults file that needs to be eliminated.
As you get more adept at changing things, you'll make your desktop more to your liking.
xwininfo
If you're interested in seeing a bit of information about certain programs running, you can type xwininfo into a terminal and then click on any window. For example, 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 .xinitrc file.
xset
This is a command line utility to control things like your mouse, keyboard, monitor and pc speaker. Both GNOME and KDE have other graphic apps to do this stuff a lot easier, so I find myself using this less and less. But you can try it out. For example, type: xset b off to stop your computer from beeping at it. And to turn it back on? You guessed it: xset b on. You can also change the tone by typing something like: xset b 30 550 300 The first number is for volume, the second pitch and the third duration of the beep.
xsetroot
In a previous section, we told you how to use xv to put your favorite picture on your desktop. If you get tired of pictures and you want something plain, you can use xsetroot to just put a color scheme on the desktop. For example, typing: xsetroot -solid seagreen will get you a solid dark green color as a background. This one is soothing to the eyes. It's the same color used on pool and card tables. Of course, you're free to use the color you like! Type: man xsetroot to see other options.
Subscribe to:
Comments (Atom)