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 its use.
In sidux you can find the terminal/konsole close to the K-menu symbolised 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 recognise 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 very 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 and/or terminal may become corrupted, type:
reset
and hit enter key.
If a konsole and/or terminal's output appears distorted. You can often cure this problem by pressing ctrl+l, which redraws the terminal window. This distortion happens mostly when working with programs that use the ncurses interface, such as irssi
A konsole and/or terminal on occasion may appear to be frozen, however, it is not, and anything you type will still be processed. This can be caused by pressing ctrl+s accidentally. In this case, try ctrl+q to unlock the terminal.
About sux
Numerous commands need to be run with root privileges. To achieve this you type:
sux
While the common command for becoming root is 'su' using sux instead will allow you run GUI / X11 applications from the command line and allow root to start graphical applications, as sux is a wrapper around the standard su command which will transfer your X credentials to the target user.
An example of running an X11 app via sux is to use a text editor to edit a root file with kwrite or kate, or to do partitioning with gparted or use an Xapp file manager like konqueror. You can also alter root files by right clicking the file and choosing 'edit-as-root', and entering your root password, this will call kdesu in the background.
Unlike 'sudo', it means that someone can't just come along and type 'sudo' and make potentially damaging changes to your system.
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 very possible to seriously harm your system.
Under no circumstances should you be as root in the console/terminal to run applications that a standard user uses to go about being productive on a day to day basis, like sending emails, creating spreadsheets or surfing the internet and so forth.
Command Line Help
Yes there is. Most Linux commands/programs comes with its own manual called a "man page" or "manual page" accessible from the command line. The syntax is:
$ man command-name
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
To escape from the man pages type q to quit
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 its use, see it's man page.
Linux Terminal Commands List (excerpt)
This is an excellent primer on using BASH from linuxcommand.org
A very comprehensive list of 687 commands in alphabetical order from Linux in a Nutshell, 5th Edition: O'Reilly Publications can be found here and is a 'must bookmark'
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.
A script and how to use them
A shell script is a convenient way to group multiple commands together in a file, By entering the filename of the script every command will be executed in turn. sidux comes with several useful scripts in order to make life easier for the users.
If the shell-script is in your current working directory
./name_of_shell-script
Some scripts require root access (sux) in a terminal and others do not, it depends entirely on the purpose of the script.
Script Installation and execution procedure
Use wget to download the script file, placing it wherever it has been recommended to place it (for example it may ask you to place it in /usr/local/bin) , you can use your mouse copy and paste file name directly into your konsole window, after logging in as sux
Example of using wget that requires root access (sux)
sux cd /usr/local/bin wget script-name
You then need to make the file executable
chmod +x script-name
You can also use a browser to download a script file then place it where it has been recommended to place it, however you will still need to make it executable.
Example of using wget as a user
To place a file in your $HOME as a user '$':
$ wget http://bluewater.sidux.com/shell-script-test/test-script.sh
$ 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 sidux-manuals http://manual.sidux.com

Search online - offline