Text 94, 332 rader
Skriven 2004-08-01 13:34:18 av Pascal Schmidt (1:153/401.2)
Ärende: Linux FAQ (2/5)
=======================
----- xab begins -----
where Unix and Linux concepts differ a lot from what people know
from DOS or Windows-like systems.
+-+
2.1 How do I get started?
Contributed by: Pascal Schmidt
Getting started is one of the most difficult parts on Linux. A lot
of people have complained of not knowing anything, for example, how
to list a directory? The Linux console can be a frightening and
strange place at first. Don't let this scare you off. There are
several good GUIs (Graphical User Interface) available for Linux,
and most distributions install one by default. Try finding your way
on the GUI first. It is easier to read documentation there and then
dive down to the console level once you think you have started to
get a grip.
Some distribution come with paper documentation that tries to help
new users with Linux. Read it, most of it seems to be quite usable.
You can also check your distribution's CD - some of them have the
HTML version of their documentation stored on the disk, so you can
read some of it before you even begin installing Linux. Reading
documentation is something you will find yourself doing quite often
as a new linux user.
+-+
2.1.1 Where do I find documentation?
Contributed by: Pascal Schmidt
One of the better sources of information you may find installed on
your Linux system are the HOWTO documents. These are maintained by
the LDP (Linux Documentation Project), are written by fellow users,
and explain (often in astonishing detail) how to set up things on
your Linux system. You may already have them installed somewhere
under the /usr/doc directory. There is a series of HOWTOs written
for people with experience in other operating systems - for example,
the DOS-to-Linux-HOWTO. Read this if there is one for your previous
OS.
Other useful information about commands can be found in the man
pages. There is one for most commands available on the console. For
example, try
man ls
to see the man page for the ls command. The man pages can be very
technical and difficult to understand - but once you know what
program you want to use, the man page to that program will usually
helps a lot. If you don't know what you want to use, you can try
apropos or whatis. They will give you a list of man pages which
contain a keyword which you specifiy. Example:
apropos directory
This will print out a list of man pages with short summaries, all
about programs that deal with directories. If this command doesn't
seem to work for you, you probably need to run the makewhatis
command first. Do this as the root user (system administrator). It
will generate the database that apropos and whatis use.
Info pages are very similar to man pages, but include hyperlinks
and other nifty add-ons. ;) You can try
info tar
for an example. Be warned: the normal info reader is considered to
be one of the most user-unfriendly programs around. You can run
info without arguments to get a table of all the info pages that
are installed on your system.
If this all doesn't help you very much, try looking around the
directory structure below /usr/doc. Maybe you will find lots of
interesting documentation there. Of course, if you start to get
lost, you could also try asking a question or two on the LINUX
echo. ;)
There may also be local Linux-related echomail conferences in your
area, check them out.
For questions related to running a BBS under Linux, you may want to
know about the LINUX_BBS echo. Give it a try.
+-+
2.1.2 How do I?
Contributed by: L. Lucier, Francois Thunus, Pascal Schmidt
How do I shut down my system?
As with most advanced operating systems, it's not a wise thing
to simply power down the computer while Linux is still running.
There is a lot of disk caching going on, and you might end up
losing valuable data. Use the shutdown command. See the manpage
for the syntax. There are often two symbolic links
halt
and
reboot
that do the obvious things.
How do I find out things about my system?
uname -a gives the version of your operating system
ldconfig -v gives a list of installed libraries
env lists the current environment
cat /proc/cpuinfo lists info about your CPU
cat /proc/meminfo the same for memory
free also lists memory, but is easier to read
lsmod lists what kernel modules are loaded
df lists free disk space for all file systems
ps -fax lists running processes
find / -name "x" tries to find the file named x
whereis "x" does the same, using a database
locate "x" same as whereis
updatedb creates/updates the database for whereis
and locate (do this as root)
Some of these may not be on the $PATH for ordinary users. You
can still use them, but need to type the full path. For example,
to run lsmod, you may need to type:
/sbin/lsmod
+-+
2.1.3 How do I get out?
Contributed by: L. Lucier, Francois Thunus
On Linux, it it sometimes possible to be stuck inside a program
without knowing how to quit the damn thing! Standard keys to
try in such a situation are:
Ctrl-Z this suspends a process
Ctrl-D end-of-file character
q for less, man and others
<esc>:q! this quits vi
Ctrl-X Ctrl-C this quits emacs
F10 for mc and similar programs
Ctrl-C on console, will stop the current process
If you are running X Window and need to shut it down, thereby
killing all X Window programs, you an press Ctrl-Alt-Backspace.
This will terminate the X server (this can be disabled, but on
most systems will be available).
+-+
2.1.4 Useful programs for newbies
Contributed by: Pascal Schmidt
This section lists a few program which are considered very nice
tools by the echo community, and show up in posting quite
frequently.
mtools
The mtools are a suite of program which make access to DOS-
formatted floppies easier. To access a floppy with mtools,
simply put an "m" in front of the command you know from DOS.
For example,
mdir a:
will list the directory for the first floppy drive. This
works for almost all DOS commands. For the usual Unix way to
deal with DOS floppies, see the section on mounting, below.
Midnight Commander (mc)
The Midnight Commander comes in very handly for people who
are used to programs like Norton Commander or Windows
Commander. mc behaves like those programs, which makes it
very easy to navigate along the directory structure and
deal with files. The internal editor of mc is also very
close to the way DOS editors work. Most normal Unix editors
can be difficult to use for the unexperienced. ;) mc has
lots of features, such as looking into archive files or
connecting to ftp servers. Type in
mc
to see if you like it. Other tools which are somewhat
similar are GIT and Ytree (which is close to being an
xtree-gold clone).
+-+
2.2 What's all this file system business?
Contributed by: Francois Thunus, Pascal Schmidt
If you used DOS or Windows before, you will be used to have drive
letters (A:, C:, and so on) for your partitions and disk drives.
This is not true for Linux. Linux presents one directory tree to
the user. Instead of having different drive letters for different
devices, you can mount other devices on directories. The contents
of that device are then visible in that directory. For example,
let's say you have a directory called /mnt/cdrom, which is empty.
You also have a CD with the directory "backup" on it. If you now
mount the CD on /mnt/cdrom, you will see the "backup" directory as
/mnt/cdrom/backup, inserted into the normal directory tree.
+-+
2.2.1 How do I mount a drive?
Contributed by: Francois Thunus, Pascal Schmidt
To mount a file system, you will need to know three parameters: the
device the file system is on, the directory where you want to mount
it, and the type of the file system. The latter one can be guessed
by the mount command, but it is considered to be more safe to give
it on the command line. The basic syntax for mount it:
mount -t type /dev/the_device /the/mountpoint
Take a look at "man mount" for a listing of possible file system
types. For example, if you wanted to mount a DOS disk in your
first floppy drive on /floppy, you would type
mount -t fat /dev/fd0 /floppy
This works because /dev/fd0 is the name of the first floppy drive
under Linux. /dev/fd1 is the second one. There are also qualified
names like /dev/fd0u1440, which also specify the exact floppy
type used. This is normally autodetected on 3.5" drives, but if you
have strange hardware, you may need to give one of those device
names to mount.
Unmounting a device is done with the umount (note the absence of
the "n" in the name) command. This takes the device name OR the
mount point as its parameter. IMPORTANT: never eject a removable
medium before you have unmounted it! Linux caches write operations
in memory, so you may end up with incorrect data on the disk when
you eject it without unmounting first.
+-+
2.2.2 Is there a standard file system layout?
Contributed by: Ed Suda, Francois Thunus, Sune Stjerneby, Pascal
Schmidt, Martin van Beilen
There is a standard for file system layout under Linux called the
Filesystem Hierarchy Standard (FHS), but this is not implemented
by all distributions. Sometimes there are even large differences.
So please take this overview as a hint only. Your system may be
different.
/bin binaries required for booting, also accessible
by normal users afterwards (example: ls)
/boot various files used during booting, including
the kernel
/dev device files (used for I/O)
/etc configuration files
/etc/rc.d more configuration files related to system
initialization
/home user's home directories
/lib system libraries
/proc a virtual directory which contains information
files from the kernel itself
/root the home directory of the root user
/sbin system administration commands for bootup,
usable mainly by root
/tmp temporary files
/usr the normal user system, including binaries,
nearly all the stuff not needed on booting
/usr/local contains the same hierarchy as /usr, but is
meant for locally installed programs (that did
not come with the distribution, for example)
/opt similar to /usr/local, but often used for big
packages (like Netscape)
/var variable data - the idea was/is: only var
needs to be mounted read/write. What about
/home, I hear someone scream? Well, /var/users
was/is also a location used for user homes.
You may also have a man page on your system that describes the file
system layout in more detail. Just try:
man 7 hier
If you have internet access, you can download the FHS at:
http://www.pathname.com/fhs/
+-+
2.2.3 What about my DOS/Windows/OS/2/... file systems?
Contributed by: Pascal Schmidt, Francois Thunus
Linux can read a lot of foreign file system formats. These include
the DOS fat system, its Windows successors called vfat and fat32,
the OS/2 HPFS, even the Windows NT NTFS. This is only a small
subset, there are a lot more. For some systems, such as HPFS and
NTFS, Linux can only read the file system, not write to it. This
may and will change with newer kernel versions coming out.
As Linux also exists on hardware platforms different from the PC,
there is also support for some file system not commonly found in
PCs (and not supported by most operating systems): the hfs system
used by the Macintosh computers and the affs used on the Amiga are
just examples.
+-+
2.3 How do I manage packages on my system?
Contributed by: Pascal Schmidt
Package management is one of the main concepts in a modern Linux
distribution. A package is a piece of software bundled together
with dependency information (what other packages need to be
installed for the package to work), install and uninstall
instructions, and a list of files that belong to the package. The
----- xab ends -----
--- Msged/LNX 6.1.1
* Origin: Chop wood, carry water. (1:153/401.2)
|