Definicija terminal/konzole

Terminal, isto zvan konzola i u KDE, konsole, je program koji omogući da interagirate direktno s Linux operativnim sustavom. Možete izvoditi različite naredbe koje su izvođene odmah. Puno puta je zvana 'shell' ili 'naredbena crta', terminal je snažan alat, i dobro je uvijek znati kako je trebate koristiti.

Kod sidux možete naći terminal/konzolu blizu K-meni simboliziran s PC monitorom. Ovisno o vašoj temi isto može da izgleda kao školjka. Možete je isto naći pod K-meni "System".

Kad otvorite terminal prozor bit će vam prezentiran terminal prompt koji ima ovaj format:

username@hostname:~$

Trebali bi prepoznati korisničko ime kao vaše ime za prijavu. ~ (tilde) pokazuje vam da ste u vašem home direktoriju i $ da ste prijavljeni s korisničkim privilegijama. Na kraju imate cursor. To je vaša naredbena crta di upišete naredbe koje hoćete da izvodite.

Puno naredbi trebate startovati sa root-privilegijama. Da ih dobijete upišite sux u prompt i pritisnite enter. Biti će te pitani za root-lozinku. Upišite vašu lozinku i pritisnite opet enter (kad pišete lozinku ništa nećete vidjeti na promptu).

Ako je vaša lozinka pravilna prompt će se promijeniti:

root@hostname:/home/username#

POZOR: Ako ste prijavljeni kao root, sistem vas neće zaustaviti kad radite opasne stvari, kao brisanje važnih podataka etc., morate bit apsolutno sigurni što radite, zato što je moguće da ozbiljno škodite vašem sistemu.

Kad se promjeni $ u # (hash). U terminal/konzoli # uvijek pokazuje da ste prijavljeni sa root privilegijama. U ovom priručniku mi ćemo sve ignorirati što je ispred $ ili #. Naredba kao:

# apt-get install something

Znači: Otvori terminal, postanite root (sux) i upišite naredbu na # prompt. (Nemojte upisati #)

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.

Malo upozorenja na sux: naredba za prijavu kao root je 'su' ali koristeći 'sux' daje vam pravo da izvodite X11 aplikacije sa naredbene crte.

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 like kwrite or kate, to do partitioning with gparted or 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.

Pomoć za naredbenu crtu

Da tu je. Većina Linux naredbi/programa dođu sa svojim priručnikom, tako zvane "man page" ili "manual page" koje su dostupne sa naredbene crte. Syntax je:

$ man "naredba"

To će otvoriti 'manual page' za tu naredbu. Navigirajte dolje i gore sa cursor tipkama. Kao primjer pokušajte:

$ man apt-get

Da zatvorite man page upišite q

Drugi uslužni program je "apropos" naredba. Apropos osnovno omogući vama da tražite u man pages naredbe pri kojima ne poznate cijeli syntax. Kao primjer pokušajte:

$ apropos apt-

To će navesti sve naredbe za paket menadžera 'apt'. 'apropos' sredstvo je snažan alat, ali opisati ga u detalju je malo previše za ovaj priručnik. Za detalje korištenja, pročitajte man page.

Lista Linux Terminal naredbih

This is an excellent primer on using BASH from linuxcommand.org

Vrlo dobra lista za 687 naredbe u alfabetskom redoslijedu sa Linux in a Nutshell, 5th Edition : O'Reilly Publications možete naći ovdje. To je "must have Bookmark"

Ima mnogobrojnih tutoriala u Internetu. Jedan dobar za početnike je: A Beginner's Bash

ili koristite vas najmiliji stroj za pretraživanje da više nađete.

Skript i kako ga koristiti

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

Da izvodite skript, otvorite terminal/konzolu, i upišite ime skripta:

$ ./test-script.sh

Onda bi trebali vidjeti ovo:

Congratulations user
You successfully downloaded and executed a bash script!
Welcome to sidux-manuals http://manual.sidux.com
Content last updated 27/11/2007 0400 UTC