Linux' Basic Use
Welcome to the Haifa Linux Club
lecture about Basic Use of Linux. This lecture will cover both using
"X-Windows", the Linux windowing interface, with a lot of focus on its
KDE desktop environment. It will also cover using the Linux' command-line
interface, because some things in Linux can only be done or are better done
at the command-line.
1 X-Windows and KDE
-
X-Windows can be invoked from a
login console by typing startx at the command-line.
-
KDE is a desktop environment built
above X-Windows, that supply the user with a modern look and feel.
1.1 Similarities to Windows
-
The "K" Button at the bottom-left corner of the screen behaves much like
the "Start" button on Windows.
-
The folder icon with the house picture opens a file manager window.
-
The KDE File Manager looks and feels very much like the Windows Explorer.
-
Moving Windows around and clicking on their decorations will yield the same
effect as in Windows.
1.2 The Workspaces
-
KDE supports more than one workspace in which one can put windows.
-
You can switch to a different workspace by pressing its number in
the workspaces display at the bottom panel.
-
When you switch to a different workspace, and return to the original,
you will find all the windows that were opened in the original.
1.3 Show the Desktop
-
The Icon with the desktop and the lamp on the KDE panel shows the
desktop.
-
It temporarily hides all the windows.
-
To show them again, press it again.
1.4 Cut and Paste in X-Windows
-
Usually just marking text will copy it to the clipboard.
-
Sometimes however, you'll have to press Ctrl+C or the menus'
copy command to copy the marked text to the clipboard.
-
Pressing the middle mouse button will paste it to the active
window.
1.4.1 Klipper
-
KDE has a panel applet that stores older contents of the clipboard
and is able to restore them.
-
To restore a previous content of the clipboard click the clipboard icon
with the K on top near right side of the bottom panel.
-
Then, choose the content you wish to use, and click its entry in the menu.
2 The Linux Console
-
The Linux console is a very useful resource for beginners and experts alike.
-
X-Windows allows the users to invoke several console windows and let them
all be visible and accessible at the same time.
-
Nevertheless, a full-fledged shell can also be accessed over an
Internet connection.
2.1 Opening a Console Window
-
To open a console window, press the screen-and-clamshell icon at the KDE panel.
-
A console window will pop up and you can move, minimize and resize it like
any other window.
2.2 Exiting from a Console Window
-
To exit from a shell type exit and press Enter at the command
line of the console.
2.3 The Command Loop
-
To use the shell type a command and press enter.
-
Once the command finished running, the shell prompt will re-appear, at which
point you can enter another command.
-
Here is an example session:
shlomi:~$ ls
apps cddb Download mail nsmail smart-link.txt~
Arcs CD-Writing GNUstep Mail progs tmp
autosave conf index.html Music Projects To_Send
Backup Desktop ip-noise.fig Nautilus Rpms Xrootenv.0
bin Docs links nohup.out smart-link.txt
shlomi:~$ pwd
/home/shlomi
shlomi:~$ cd Download/
shlomi:~/Download$ ls
Arcs Docs From_Win Images unpack
shlomi:~/Download$ echo Something
Something
shlomi:~/Download$ cd ..
shlomi:~$ exit
|
2.4 Shell Goodies
-
You can recall the previous commands you entered by using the Up and Down
Arrow keys.
-
You can edit the command line by using such keys as Left and Right (move one
character), Ctrl+A and Ctrl+E (to the start/end of the line),
or Alt+F and Alt+B (move one word forwards/backwards).
-
By typing the beginning of a filename or filepath, you can complete the rest
of it by pressing the TAB key. Typing tab a second time will give you the
avialable filenames with this prefix.
-
Pressing enter will always execute the command, even if the cursor is in the
middle of the line.
3 Getting Help
-
There are several ways one can get help while using Linux, even without
connecting to the Internet.
-
We will cover some of them here.
3.1 The Man Pages
-
A Man page is a manual that covers a certain Linux command.
-
To access the listing of man pages, open a KDE web-browser and type
man:/ at the Location display.
-
For Linux commands, you'll be interested in Section 1.
-
To access a man page for a particular command type "man:/[Command Name]"
at the Location display.
3.2 Apropos
-
The "apropos" command searches the man pages for keywords that are defined
in the man pages.
-
To use it open a console and type apropos [keyword]
at the prompt.
3.3 The "Info" manuals
-
The Info manuals are detailed guides that describe certain commands
and applications.
-
To access them type info:/[cmd name] at the location entry
of a KDE browser.
-
For instance info:/gcc will display the manual of "gcc".
3.4 The on-line HOWTO's
-
You can find the Linux HOWTO's in HTML in the directory
/usr/share/doc/HOWTO/HTML.
-
The HOWTO's are guides that cover a specific subject and tells you "how to"
do certain common tasks.
3.5 Internet Resources
-
There are numerous mailing-lists for various Linux subjects. A list of
Isreali ones can be found here:
http://www.iglu.org.il/mailing-lists/
.
-
Many times searching the web using web engines will yield good information.
Google and Google Groups are especially very good.
-
Remember to RTFM (Read the Fabulous Manual) and STFW (Search the Fabulous Web)
before you ask a mailing list.
4 Editing with Vi
-
Vi is the most commonly available text editor on UNIX systems.
-
It is a console editor and runs inside a terminal.
-
There are various other editors available, but we chose to show vi
because it is the most common and the most accessible.
4.1 Invoking Vi
-
To invoke vi, once in a shell, enter the command
vi [filename] where [filename] is the name
of the file you wish to edit.
4.2 Command Mode and Editing Mode
-
Vi has two modes of operation: command mode and editing mode.
Vi starts in command mode.
-
In editing mode, one can insert new text.
-
In command mode, one can enter a myriad of commands, including ones
to save the file, or to delete text.
4.3 Exiting from Vi
-
To exit Vi, one has to be at command mode.
-
When in command mode, type :q and press Enter to
exit from Vi.
-
You cannot exit this way unless the file you edited is saved.
4.4 Entering and Exiting from Editing Mode
-
To enter editing mode, use the arrow keys to move the cursor to the location
in which you wish to enter text, and press "i".
-
You can now enter text freely, and delete the text that was just
entered by pressing the backspace key.
-
When you are done entering text, press ESC to return back to command mode.
-
Note: Pressing ESC twice will always put you back in command mode.
4.5 Deleting Text
-
To delete text in Vi, one has to be in command mode.
-
To delete a single character, position the cursor on it and press the
"x" key.
-
To delete a single line, position the cursor somewhere on it and press
"d" twice.
4.6 Saving the File
-
To save the file, enter command mode.
-
Then type :w and press enter.
4.7 Exiting without saving changes
-
To exit without saving changes, enter command mode.
-
Then, type :q! and press enter.
5 Links and References
Command-Line Usage
UNIX Help for Users - a detailed
on-line guide that explains the basic of UNIX usage
The Linux Installation
and Getting Started Guide - another good online book.
The Linux Users' Guide - a book available for download in PDF format.
X and KDE
The KDE Documentation
- contains a user guide and a quick start guide.
Vi
The Vim HOWTO -
contains a lot of information regarding Vi, including many links.