by Pete Kelly (critter)
If you are reading this, then you are most probably a PCLinuxOS user who has previously only used Windows. That simple fact suggests that you are someone a little bit special, someone who doesn't accept just whatever is offered, but someone who wants to look at other options and make their own decisions. Someone who wants to explore and to see if there is more to something than it seems at first glance.
After you have been using Linux for a couple of weeks and you have become accustomed to where things are and what they are called, you may realize that, for the most part, you are working much as you used to in Windows: pointing, clicking, cutting and pasting, dragging and dropping and so forth. So what's the big deal about Linux, apart from being free?
I could mention that you don't need to use anti-virus programs, although they are available if you really want them, or I could talk about how reliable it is, but this is supposed to be about the terminal in Linux so let's talk about that.
What you have been using so far is a graphical interface to the system, but that is not the only way that you can interact with the system, and it is not the way that Linux was designed. Sure, the graphical applications with their buttons and menus make things easy to use and nice to look at too. That's fine, and it's the way that most people spend most of their time, myself included, but there are times when it is just not the best way to do things, and there are some things that just can't be done in the graphical environment. It is at these times that we turn to the other way, the text way, usually known as the command line interface.
This command line interface is not unique to Linux. Windows and Mac machines also have one, although they are not used as much by ordinary users. The command line interface (I'm going to call it the CLI from here on out, since I tired of typing it out in full) is capable of unleashing the full power of Linux, but that is not the purpose of these articles. Here, we will discuss only the basic things that users should know about using the CLI.
Well there are quite few good reasons to learn to use this CLI.
One reason is that if you seek help from some of the more knowledgeable users on the forum or in the IRC support channel about a difficulty that you are experiencing, then they may ask you to type something into a terminal, and you should be familiar with that process.
Some things are done more easily with the CLI, and some things can be done only in the CLI.
There are lots of distributions of Linux, all with their own flavours and, unlike Windows, there are many graphical environments such as KDE, LXDE, Gnome and Xfce, that operate in a slightly different manner. But once you are familiar with the CLI, you can feel at home in any of these distributions.
In a graphical application, you are restricted to using only the tools and commands that the software developer decided to include. By using the terminal, this restriction is lifted, you decide which commands to use, and how to use them. You can easily create your own tools and routines that do exactly what you want. You are in total command and you can talk to the system in a language that it understands.
Yet another reason to learn to use this CLI is to satisfy your curiosity, and to discover just what you can achieve in Linux, what with you being a little bit special n'all.
A terminal is how we use the CLI, and we usually use a terminal emulator application that runs in your familiar graphical environment, although this is not the only way. If you are using the KDE environment then you will have a terminal emulator called Konsole, but which one you use doesn't matter. If you use Xterm, Eterm or any of the many others, the results will be the same. If somebody tells you to open a terminal, then this is what they mean.
I'll use Konsole here, simply because I have a shortcut to it on my desktop.
Only ever open a terminal as root when absolutely necessary -- the so called 'super user,' as you can damage the system with a wrongly constructed command when working as root. Sometimes you may be instructed to do so when seeking help from more experienced users, and even then, you should go carefully and reread what you have typed before pressing the Enter key. There are safer ways to do things when you need special privileges, which will limit the possibilities of causing accidental damage. We will cover these methods in a later article.
Open a terminal. Yours may look slightly different.
Ignore the menu headings in the picture and look at the first line, the one that ends in $. This is known as the prompt and it is prompting you to type in something. To demonstrate the use of the terminal I have created the unimaginatively named user linux_user. Your user name should appear in its place.
What appears here is fully customizable, but in a default PCLinuxOS installation it will show user_name @ hostname and the current directory. Here the squiggly character or tilde is used as a shorthand way of saying “my home directory.”
A directory is the same as a folder in Windows and, since Linux is a multi-user system, each user is allocated their own 'home' directory to store their personal files and settings. The hostname is the name of this computer as it will be seen on the local network which, if not set, will default to the word localhost.
To verify that we are actually working in our home directory we can type in the command pwd after the dollar sign ($), and hit the enter key. The pwd command means 'print working directory.' Make sure that you use lower case letters for the command, as Linux is case sensitive.
The command is executed and /home/linux_user is printed to the screen verifying that we are in fact in our home directory, and the the prompt is repeated waiting for us to type in something else for it to work on. You may also have noticed that there is no drive letter, as you find under Windows. This is perfectly normal. Linux doesn't use drive letters, as the file system is structured differently. You may find this rather strange at first, but you will soon become familiar with it.
The next command I want to use is ls (small L, small S) which means 'list the contents of this directory' (This is like the dir command in MS-DOS or on the windows command line). Type ls at the prompt and press the Enter key.
The names of the files and sub-directories or folders in the directory are printed to the screen.
So that, essentially, is how the alternative, text based interface to the operating system is implemented. In the next few articles, we shall learn some more about the terminal and the CLI. Enough to get you on course to be able to follow directions when needed and to do the basic operations that will get you around in the terminal.
If you get through these basic instructions, then you will have a good understanding of what the CLI is all about. Mastering it will take a little longer. It is a skill which is not necessary to be able to use Linux, but is still an extremely useful tool to have.
When you are ready to learn more about the CLI and dig a little deeper into the Linux command line, you can download the Command Line Interface Intro Special Edition of The PCLinuxOS Magazine. This edition of The PCLinuxOS Magazine presents all 12 articles from the pages of the magazine, arranged in an orderly way to teach you the command line basics from the very beginning.
With the graphical interfaces, such as KDE, you can use Linux. In the terminal you can control Linux. How much control you have depends upon your level of understanding of the Linux system, but a very basic knowledge can enable you to master some of the things are not so easily achieved using only the graphical interface.