Definition of terminal/konsole

A terminal, also called console and in KDE konsole, is a program that makes it possible to interact directly with the Linux operating system by issuing various commands which are then executed immediately. Also often referred to as a 'shell' or 'command line', the terminal is a very powerful tool and it's well worth the effort to gain some basic understanding of it's use.

In Joatha you can find the terminal/konsole close to the K-menu symbolized by a PC monitor. Depending on your theme it may or may not also contain the image of a shell. You will also find the same icon in the K-menu under "System".

When you open a terminal window you will be presented with the terminal prompt which will have the format of:

username@hostname:~$

You should recognize the username as your own login name. The ~ (tilde) indicates that you are in your home directory and $ indicates that you are logged in with user privilege. At the end you will have your cursor. This is your command line where you will enter the commands you want to execute.

A lot of commands need to be run with root privileges. To achieve this you type sux at the prompt and press enter. You will then be asked for your root password. Type your password and hit enter again (note that when you type your password, nothing will show on the screen).

If your password is correct the prompt will change to:

root@hostname:/home/username#

WARNING: While you are logged in as root, the system will not stop you from doing potentially dangerous things like deleting important files etc., you have to be absolutely sure about what you are doing, because it's fully possible to seriously harm your system.

Note that the $ sign has changed into a # (hash). In a terminal/konsole the # always indicates that you are logged in with root privileges. Throughout this manual we will omit everything in front of the $ or the #. So a command like:

# apt-get install something

Means: Open a terminal, become root (sux) and enter the command at the # prompt. (Don't type the #)

Sometimes a konsole may become corrupted , simply type

clear
and hit enter key
or
ctrl+l

A little note on sux: The common command for becoming root is 'su' but using 'sux' instead also lets you run X11 applications from the command line.

Command Line Help

Yes there is. Most Linux commands/programs comes with it's own manual called a "man page" or "manual page" accessible from the command line. The syntax is:

$ man "command"

This will bring up the manual page for that command. Navigate up and down with the cursor keys. As an example try:

$ man apt-get

Another useful utility is the "apropos" command. Apropos basically enables you to search the man pages for a command if you e.g. don't remember the complete syntax. As an example you can try:

$ apropos apt-

This will list all commands for the package manager 'apt'. The 'apropos' utility is a quite powerful tool, but describing it in detail is way beyond the scope of this manual. For details of it's use, see it's man page.

To escape from the man pages type q

A script and how to use them

A script is basically multiple commands bundled together in a file. By entering the filename of the script every command will be executed in turn just like an ordinary program. Joatha comes with several useful scripts in order to make life a little easier for the users. If the shell-script is in your directory but not in the path, use

./name_of_shell-script
Script Install and execution procedure

1. You can either download a script file then put it in wherever its been recommended to place it (for example it may ask you to place it in /usr/local/bin), or
2. Use wget to download it (hint: you can copy and paste file directly into your konsole window, after logging in as sux in console:

wget whatever-the-shell-script-is-called

For this example, place the file in your $HOME:

sux
wget http://bluewater.Joatha.com/shell-script-test/test-script.sh

You then need to make the file executable no matter how you downloaded it:

chmod +x whatever-the-shell-script-is-called

For example:

chmod +x test-script.sh

To run a script, open a terminal/konsole, and run the script name:

./test-script.sh

You should then see this:

Congratulations user
You successfully downloaded and executed a bash script!
Welcome to Joatha-manauls http://manual.Joatha.com

Where to learn more

There are numerous tutorials on the Internet. A very good one aimed at the beginner is: A Beginner's Bash

Or use your favourite search engine to find more.

Content last updated 12/01/2007