1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4
<!ENTITY % globalent SYSTEM "../../../libs/global.ent">
6
<!ENTITY % cdo-C SYSTEM "../../../libs/cdo-C.ent">
8
<!ENTITY % kde SYSTEM "../../../libs/kde.ent">
10
<!ENTITY % kde-menus-C SYSTEM "../../../libs/kde-menus-C.ent">
12
<!ENTITY % kde-general SYSTEM
13
"/usr/share/apps/ksgmltools2/customization/obsolete/general.entities">
15
<!ENTITY % xinclude SYSTEM "../../../libs/xinclude.mod">
17
<!ENTITY language "en">
19
<article id="basic-concepts" status="complete">
21
<title>Basic Concepts</title>
25
This chapter introduces you to basic concepts which are useful when getting
26
started with a Kubuntu system.
31
<!-- DIRECTORIES AND FILE SYSTEMS -->
32
<sect1 id="directories-file-systems" status="complete">
33
<title>Directories and File Systems</title>
36
In Linux and Unix everything is a file. Directories are files, files are files,
37
and devices are files. Devices are usually referred to as nodes; however, they
42
Linux and Unix file systems are organized in a hierarchical, tree-like
43
structure. The highest level of the file system is the <filename>/</filename>
44
or root directory. All other files and directories exist under the root
45
directory. For example, <filename>/home/konqi/kubuntu.odt</filename> shows
46
the correct full path, or absolute path, to the <filename>kubuntu.odt</filename>
47
file that exists in the <filename>konqi</filename> directory, which is under
48
the <filename>home</filename> directory, which in turn is under the root
49
(<filename>/</filename>) directory.
53
Underneath the root (<filename>/</filename>) directory is a set of important
54
directories common to most Linux distributions. The following is a listing of
55
common directories that are directly under the root (<filename>/</filename>)
60
<varlistentry><term><filename>/bin</filename></term>
63
Important commands, which historically have been <emphasis>bin</emphasis>ary,
64
but may also be shell scripts.
69
<varlistentry><term><filename>/boot</filename></term>
72
<emphasis>Boot</emphasis> configuration files, kernels, and other files needed
73
at <emphasis>boot</emphasis> time.
78
<varlistentry><term><filename>/dev</filename></term>
81
The <emphasis>dev</emphasis>ice files.
86
<varlistentry><term><filename>/etc</filename></term>
89
Configuration files, startup scripts, <emphasis>etc</emphasis>.
94
<varlistentry><term><filename>/home</filename></term>
97
<emphasis>Home</emphasis> directories for different users.
102
<varlistentry><term><filename>/initrd</filename></term>
105
Used when creating a customized <emphasis>init</emphasis>ial
106
<emphasis>R</emphasis>AM <emphasis>D</emphasis>isk.
111
<varlistentry><term><filename>/lib</filename></term>
114
System <emphasis>lib</emphasis>raries.
119
<varlistentry><term><filename>/lost+found</filename></term>
122
Provides a <emphasis>lost+found</emphasis> system for files that exist under the
123
root (<filename>/</filename>) directory.
128
<varlistentry><term><filename>/media</filename></term>
131
Automatically mounted (loaded) removable <emphasis>media</emphasis> such as CDs,
132
digital cameras, etc.
137
<varlistentry><term><filename>/mnt</filename></term>
140
Manually <emphasis>m</emphasis>ou<emphasis>nt</emphasis>ed filesystems on your
146
<varlistentry><term><filename>/opt</filename></term>
150
Provides a location for <emphasis>opt</emphasis>ional (3rd party) applications
151
to be installed; these are usually statically compiled and can be used in other
152
versions or Linux distributions.
157
<varlistentry><term><filename>/proc</filename></term>
160
Special dynamic directory that maintains information about the state of the
161
system, including currently running <emphasis>proc</emphasis>esses.
166
<varlistentry><term><filename>/root</filename></term>
169
<emphasis>Root</emphasis> user's home directory, pronounced
170
"slash-root".
175
<varlistentry><term><filename>/sbin</filename></term>
179
Important <emphasis>s</emphasis>ystem <emphasis>bin</emphasis>aries and scripts,
180
usually intended to be run as the root user.
185
<varlistentry><term><filename>/srv</filename></term>
188
Can contain files that are <emphasis>s</emphasis>e<emphasis>rv</emphasis>ed to
194
<varlistentry><term><filename>/sys</filename></term>
197
Similar to the /proc filesystem, but contains <emphasis>sys</emphasis>tem
198
information not related to running processes.
203
<varlistentry><term><filename>/tmp</filename></term>
206
<emphasis>t</emphasis>e<emphasis>mp</emphasis>orary files.
211
<varlistentry><term><filename>/usr</filename></term>
214
Applications and read-only files that are mostly available for all
215
<emphasis>us</emphasis>e<emphasis>r</emphasis>s to access.
220
<varlistentry><term><filename>/var</filename></term>
223
<emphasis>var</emphasis>iable files such as logs and databases.
232
<sect1 id="permissions" status="complete">
233
<title>Permissions</title>
236
All of the files on a Linux system have permissions that allow or prevent others
237
from viewing, modifying or executing them. The superuser "root" has the ability
238
to access any file on the system. Each file has access restrictions, user
239
restrictions, and an owner/group association.
243
Every file is secured by the following three layers of permissions, in order of
248
<varlistentry><term>user</term>
251
Applies to the user who is the owner of the file.
256
<varlistentry><term>group</term>
259
Applies to the group that is associated with the file.
264
<varlistentry><term>other</term>
267
Applies to all other users.
274
Inside each of the three sets of permissions are the actual permissions. The
275
permissions, along with the way they apply differently to files and directories,
280
<varlistentry><term>read</term>
283
Files or directory contents that can be <emphasis>viewed</emphasis> only.
288
<varlistentry><term>write</term>
291
Files or directory contents that can be modified or deleted.
296
<varlistentry><term>execute</term>
299
Files that can be run as a program or directories that can be entered.
306
To view and edit the permissions on files and directories, first open
307
<application>Konqueror</application> in file manager mode by selecting
308
<guilabel>Home Folder</guilabel> from the <guimenu>System Menu</guimenu> located
309
next to the <application>KMenu</application> icon in the bottom left corner of
310
your display. To display the dialog to allow permission editing,
311
<mousebutton>right</mousebutton> click on a file or directory, then select
312
<guimenu>Properties</guimenu>. The permissions are found under the
313
<guilabel>Permissions</guilabel> tab and allow for the editing of all
314
permission levels, if you are the owner of the file.
318
<!-- ROOT AND SUDO -->
319
<sect1 id="root-and-sudo" status="complete">
320
<title>Root And Sudo</title>
323
The root user in Linux is the user which has administrative access to your
324
system. Normal users do not have this access for security reasons.
325
Kubuntu does not enable the root user. Instead, administrative access is given
326
to individual users, who may use the "sudo" application to perform
327
administrative tasks. The first user account you created on your system during
328
installation will, by default, have access to sudo <emphasis>s</emphasis>uper
329
<emphasis>u</emphasis>ser <emphasis>do</emphasis>. You can restrict and enable
330
sudo access to users with the <application>Users and Groups</application>
331
application (review the <ulink type="help"
332
url="help:/kubuntu/keeping-safe/">Keeping Safe</ulink> documentation for more
337
When you run an application that requires root privileges, sudo will ask you to
338
input your normal user password. This ensures that rogue applications cannot
339
damage your system, and serves as a reminder that you are about to perform
340
administrative actions which require you to be careful!
344
To use sudo when using the command line, simply type "sudo" before the command
345
you wish to run. Sudo will then prompt you for your password.
349
Sudo will remember your password for a set amount of time (15 minutes by
350
default). This feature was designed to allow users to perform multiple
351
administrative tasks without being asked for a password each time.
356
Be careful when doing administrative tasks -- you could very well damage your
362
Some other tips for using sudo:
368
To use a "root" terminal, type "sudo -i" at the command line
374
The entire group of default graphical configuration tools in Kubuntu already
375
uses sudo, so you will be prompted for your password if needed using
376
<application>kdesu</application>, which is a graphical frontend to
377
<application>sudo</application>.
383
For more information on the <application>sudo</application> program and the
384
absence of a root user in Kubuntu, read the <ulink url="&wiki-RootSudo;">sudo
385
page</ulink> on the Ubuntu wiki.
390
<sect2 id="run-application-root" status="complete">
391
<title>Start a Program Manually with Root Privileges</title>
394
Sometimes it is necessary to run a program with root privileges. This is easy to
395
do with the <application>Run Command</application> dialog.
400
Be careful when doing administrative tasks -- you could very well damage your
408
Open the <application>Run Command</application> dialog by typing:
418
Enter the name of the program you wish to run, <emphasis>prefixed</emphasis>
419
with <application>kdesu</application> and press <keycap>Enter</keycap>. For
420
example, to launch the file manager <application>Konqueror</application>
421
with root privileges, type <screen>kdesu konqueror</screen>
429
<!-- USER MANAGEMENT -->
430
<sect1 id="user-mgmt" status="complete">
431
<title>User Management</title>
433
<procedure><title>Adding a user</title>
436
Open <application>KUser</application>, &kde;'s <guilabel>User Manager</guilabel> by going to &menukuser;.
441
If a dialog appears asking you for a password, enter your user password.
446
<mousebutton>Click</mousebutton> the <guibutton>Add</guibutton> located in the top left hand corner of the window.
451
Type the username for the new user.
456
Enter the user's details in the dialog presented to you and create a password for the new user by selecting the <guilabel>Password Management</guilabel> tab located at the top of the window.
457
<example><title>New User <guilabel>Details</guilabel></title>
460
<imagedata fileref="../../images/C/adduser_details.png" format="PNG" />
464
<example><title>New User <guilabel>Password & Security</guilabel></title>
467
<imagedata fileref="../../images/C/adduser_security.png" format="PNG" />
475
<procedure><title>Removing a user</title>
478
Open <application>Kuser</application> as noted in the previous procedure for adding a user.
483
Highlight the user that you would like to delete.
488
<mousebutton>Click</mousebutton> on the <guibutton>Delete...</guibutton> button.
493
When prompted with the <guilabel>Delete User</guilabel> dialog, you have two options:
497
<guilabel>Delete home folder: /home/username</guilabel> - this will remove
498
the user's home directory, therefor clearing up space on your hard drive. If
499
there is information you would like to backup, do so before deleting this
505
<guilabel>Delete mailbox: /var/mail/username</guilabel> - this will remove the
514
<procedure><title>Changing a user's password</title>
517
Open <application>KUser</application> by going to &menukuser;.
522
Highlight the user whose password you would like to change.
527
<mousebutton>Click</mousebutton> on the <guibutton>Edit</guibutton> button if the dialog does not open immediately upon highling that user.
532
After the <guilabel>User Properties</guilabel> dialog has opened,
533
<mousebutton>click</mousebutton> the <guibutton>Set Password...</guibutton> button in the top right corner of the window. After entering in the new password, press the <guibutton>OK</guibutton> button to finish.
540
<sect1 id="terminals" status="complete">
541
<title>Terminal</title>
544
Working at the command line is not as daunting a task as you would think. There
545
is no special knowledge needed to use the command line as it is a program like
546
everything else. Most things in Linux can be done using the command line.
547
Although there are graphical tools for most programs, sometimes they are just
548
not enough. This is where the command line comes in handy.
552
The terminal is often called the command prompt or the shell. In days gone by,
553
this was the way the user interacted with the computer; however, Linux users
554
have found that the use of the shell can be quicker than a graphical method and
555
still holds some merit today. Here you will learn how to use the terminal.
559
The original use of the terminal was as a file browser, and indeed it is still
560
used as a file browser. You can use the terminal as a file browser to navigate
561
your files and undo the changes that have been made.
564
<sect2 id="starting-konsole" status="complete">
565
<title>Starting the Terminal</title>
568
The <application>Konsole</application> can be started by going to &menukonsole;.
572
<sect2 id="common-commands" status="complete">
573
<title>Common Commands</title>
576
<varlistentry><term>View Directories: - ls</term>
579
The <application>ls</application> (LiSt) lists files in different colors with
585
<varlistentry><term>Create Directories: - mkdir (directory name)</term>
588
The <application>mkdir</application> (MaKeDIRectory) command will create a
594
<varlistentry><term>Change Directories: - cd (/directory/location)</term>
597
The <application>cd</application> (Change Directory) command will change from
598
your current directory to any directory you specify.
603
<varlistentry><term>Copy Files/Directories: - cp (file or directory name) (to
604
directory or filename)</term>
607
The <application>cp</application> (CoPy) command will copy any files you
608
specify. The <application>cp -r</application> command will copy any directories
614
<varlistentry><term>Remove Files/Directories: - rm (file or directory
618
The <application>rm</application> (ReMove) command will delete any filename you
619
specify. The <application>rm -r</application> command will remove any directory
620
you specify, and all its contents.
625
<varlistentry><term>Move/Rename Files/Directories: - mv (file or directory
629
The <application>mv</application> (MoVe) command will move/rename any file or
630
directory you specify.
635
<varlistentry><term>Find Files/Directories: - locate (file or directory
639
The <application>locate</application> command will search for any filename you
640
specify. It uses an index of the files on your system to work quickly. To update
641
this index, run the command <application>sudo updatedb</application>. This
642
command is run automatically each day if you leave your computer on. It needs to
643
be run with administrative privileges (see <xref linkend="root-and-sudo"/>).
650
You can also use wildcards to match one or more files, such as "*" (for all
651
files) or "?" (to match one character).
655
<sect2 id="switch-to-console" status="complete">
656
<title>Switching to Console mode</title>
659
The usual method of command-line access in Kubuntu is to start a terminal (see
660
<xref linkend="starting-konsole"/> above), however sometimes it is useful to
661
switch to the real console:
667
Use the &ctrlaltf1; shortcut keys to switch to the first console.
672
<para>To switch back to Desktop mode, use the &ctrlaltf7; shortcut keys.
678
<para>There are six consoles available. Each one is accessible with the
679
shortcut keys &ctrlaltf1; to &ctrlaltf6;.
684
<sect2 id="disable-terminal-beep" status="complete">
685
<title>Disabling the beep sound in Terminal mode</title>
690
Start a <application>Konsole</application> session, select by going to
699
<guimenu>Settings</guimenu>
700
<guisubmenu>Bell</guisubmenu>
701
<guimenuitem>None</guimenuitem>
703
to disable the system bell.
710
<!-- RESTART X SERVER -->
711
<sect1 id="restart-x" status="complete">
712
<title>Restart Kubuntu without rebooting</title>
715
Prior to your system having the ability to simply restart Kubuntu without rebooting, you will need to enable this option in <application>System Settings</application>. Go to &menusysset; and then press the <guibutton>Display</guibutton> icon. At the very bottom of the window, just above the <guibutton>Help</guibutton>, <guibutton>Defaults</guibutton>, and <guibutton>Reset</guibutton> buttons, there is a checkbox. Make sure to select the checkbox that says <guilabel>Ctrl+Alt+Backspace restarts the xserver</guilabel>. Press the <guibutton>Apply</guibutton> to apply your changes. You will have to log out and then back in prior to this option takes into effect.
719
Once you have configured your system to allow this option, to simply restart Kubuntu, or the <productname>X Window System</productname>, simply press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Backspace</keycap>
720
</keycombo>. This will take you to a blank screen momentarily and then bring
721
you back to the login screen (<acronym>KDM</acronym>).
725
<!-- TEXT EDITING -->
726
<sect1 id="text-editing" status="complete">
727
<title>Text Editing</title>
730
All of the configurations and settings in Linux are saved in text files. Even
731
though you most often can edit configurations through the graphical interface,
732
you may occasionally have to edit them by hand. <application>Kate</application>
733
is the default Kubuntu text editor, which can be launched by going to
738
At times in this guide, <application>Kate</application> is run from the command
739
line using <application>kdesu</application>, as most configuration files require
740
root privileges to alter them. It is recommended that you also run
741
<application>kdesu</application> from the command line when shown in this guide.
745
If you need to use a text editor from the command line, you can use
746
<application>nano</application>, which is a simple to use text editor. When
747
running it from the command line, always use the following command, which
748
ensures that the editor will not introduce line breaks:<screen>nano -w</screen>
752
For more information about how to use <application>nano</application>, refer to
753
the <ulink url="&wiki-Nano;">guide on the wiki</ulink>.
757
There are also quite a few other terminal-based editors available in Kubuntu,
758
popular ones include <application>VIM</application> and
759
<application>Emacs</application> (the pros and cons of each are cause for much
760
friendly debate within the Linux community). These are often more complex to use
761
than <application>nano</application>, but are also more powerful.