home *** CD-ROM | disk | FTP | other *** search
-
- Section 0: Introduction
-
- 0.1: Is Linux Right for You?
-
- There is no such thing as "the best computer" or "the best operating
- system": it all depends on what you have to do. For instance, I don't like
- the Mac (sacrilege! ;-): it's surely easy to use, but to do some things I
- prefer the PC by far. (Try the equivalent of dir/s/w >lst on a Mac!) Yet,
- to many folks the Mac is simply "the best" computer. Likewise, I don't
- believe that Linux is "the best" os: it is undoubtedly superior to, say,
- Win 95, but many might prefer the latter.
-
- Un*x is aimed at programmers/scientists, while Mac & Win are aimed at
- nontechnical users. Therefore, you are going to benefit immensely from
- Linux if what you need are compilers, network, and scientific sw in
- general, and if you don't mind fiddling around and fixing things yourself:
- in a word, if you like hacking. You'll hate Linux if you want everything to
- work out of the box, if you need mostly commercial sw, and if you feel lost
- typing in commands.
-
- It's up to you. Remember that Linux and DOS/Windows can coexist on the same
- machine, anyway.
-
- 0.2: It is. Tell Me More
-
- You installed Linux on the PC. You gave yourself an account following the
- installation instructions (if this is not the case, see Section 6.1) and
- Linux is running. Somebody told you that all the programs you needed were
- there, and all you have to do is login and go. You've just entered your
- name and password, and now you are looking at the screen thinking: "Well,
- now what?"
-
- Now, don't despair. You're almost ready to do the same things you used to
- do with DOS, and many more. If you were running DOS instead of Linux, you
- would be doing some of the following tasks:
-
- 1. executing programs and creating, copying, viewing, deleting, renaming
- files;
- 2. CD'ing, MD'ing, RD'ing, and DIR'ring your directories;
- 3. formatting floppies and copying files from/to them;
- 4. mending your AUTOEXEC.BAT and CONFIG.SYS;
- 5. writing your own .BAT files and/or QBASIC programs;
- 6. the remaining 1%.
-
- You'll be glad to know that these tasks can be accomplished under Linux in
- a fashion similar to DOS. Under DOS, the average user uses very few of the
- 100+ commands available: the same, up to a point, can be said for Linux.
- Incidentally, if you don't know the DOS commands for the tasks in the list,
- drop out now: I won't be explaining what such things as a directory or the
- PATH variable are.
-
- A few things to point out before going on:
-
- 1) unlike DOS, Linux has built-in security mechanisms. When you turn the PC
- on and fire up Linux, you have to "log in", that is make yourself known to
- the system; this is because Un*x is a multi-user os. Besides, the normal
- user doesn't really own the system; at login time, only the user whose
- login name is "root" has the power. (This guy's the system administrator.
- If you work on your own PC, you'll be root.) Files and directories have
- permissions associated to them, and therefore some cannot be accessed by
- the normal user. DOS, on the other hand, will let you wipe out the entire
- contents of your hard disk;
-
- 2) once you have finished working, you *must not* switch off your PC!
- Instead, you must follow the correct shutdown procedure (press CTRL-ALT-
- DEL, wait for the system to fix its innards and tell you everything is OK,
- then switch off the PC). Anyway, Linux is such a reliable os that it is
- *extremely* unlikely that an ill-behaved application will ever hang your
- machine - you'll never need to reset.
-
- 3) you are strongly encouraged to experiment, play, try by yourself: it
- surely won't hurt. You can get some help typing at the prompt ($ is the
- standard prompt, # is the prompt for root):
- $ help
- (pretty logical), or get info about a command typing
- $ man <command>
- which, if you have installed the man pages, will invoke the manual ("man")
- page associated to <command>. You may also try
- $ apropos <command>
- or
- $ whatis <command>
-
- 4) conventions:
- a) <...> means something that must be specified, while [...] something
- optional. Example:
- $ tar -tf <file.tar> [> redir_file]
- file.tar must be indicated, but redirection to redir_file is optional.
- b) from now on "RMP" means "read the man pages for further information".
-
- You are now ready to refer to the following sections.
-
-
- Section 1: Working with Files
-
- 1.1. Files: Preliminary Notions
-
- Linux has a file system - meaning by that "the structure of directories and
- files in them" - very similar to that of DOS. Files have filenames that
- obey special rules, are stored in directories, some are executable, and
- among these most have command switches. Moreover, you can use wildcard
- characters, redirection, and piping. There are only a few minor
- differences.
-
- - First difference: under DOS, file names are in the so-called 8.3 form;
- e.g. NOTENOUG.TXT. Under Linux we can do better. If you installed Linux
- using a filesystem (you needn't know what it means now) like ext2 or
- umsdos, you can use longer filenames, and with more than one dot in them:
- for example, This_is.a.VERY_long.filename. Please note that I used both
- upper case and lower case characters. In fact...
-
- - Second difference: upper case and lower case characters are different.
- Therefore, FILENAME.tar.gz and filename.tar.gz are two different files. The
- same holds true for commands: if you issue the command ls (the same as DIR
- under DOS) you'll get a list of files in your directory, but if you enter
- LS you'll get an error message.
-
- - Third difference: if you start a filename with a period, the file will be
- considered as hidden. Example: the file .I.am.a.hidden.file won't show up
- after an ls command.
-
- - Fourth difference: there are no compulsory exensions like .COM and .EXE
- for programs, or .BAT for batch files. Executable files are marked by a
- star * at the end of their name when you issue the ls -F command. For
- example:
- $ ls -F
- letter_to_Joe Cindy.jpg cjpg* I_am_a_dir/ my_1st_script*
- The files cjpg* and my_1st_script* are executable - "programs". Under DOS,
- files ending in .BAK represent backup files; under Linux, such files are
- those ending with a tilde ~.
-
- - Fifth difference: DOS program switches are obtained with /switch, while
- under Linux with -switch. Example: dir /s becomes ls -R. Note that many DOS
- programs, like PKZIP or ARJ, use Un*x-style switches.
-
- 1.2. Files: Translating Commands from DOS to Linux
-
- On the left, the DOS commands; on the right, their Linux counterpart.
-
- COPY: cp
- DEL: rm
- REN: mv
- TYPE: more, less, cat
-
- Redirection and plumbing operators: < > >> |
- Wildcards: * ?
- nul: /dev/null
- prn, lst: /dev/lp0; lpr
-
- - EXAMPLES -
-
- DOS Linux
-
- C:\GUIDO>copy joe.txt joe.doc $ cp joe.txt joe.doc
- C:\GUIDO>copy *.* total $ cat * > total
- C:\GUIDO>copy fractals.doc prn $ cat fractals.doc | lpr
- C:\GUIDO>del temp $ rm temp
- C:\GUIDO>del *.bak $ rm *~
- C:\GUIDO>ren paper.txt paper.asc $ mv paper.txt paper.asc
- C:\GUIDO>type letter.txt $ more letter.txt
- C:\GUIDO>type letter.txt $ less letter.txt
- C:\GUIDO>type letter.txt > nul $ cat letter.txt >/dev/null
- n/a $ more *.txt *.asc
- n/a $ cat section*.txt
-
- Notes:
-
- 1) * is smarter under Linux:
- - * matches all files except the hidden ones; .* matches all hidden files;
- *.* matches only those ending with . plus other characters;
- - p*r matches both peter and piper; *c* matches both picked and peck;
- 2) when using more, press <space> to read through the file, 'q' or CTRL-C
- to exit. less is more inuitive and lets you use the arrow keys;
- 3) there is no UNDELETE, so *think twice* before deleting anything;
- 4) in addition to DOS's < > >>, Linux has 2> to redirect error messages
- (stderr);
- 6) Linux has another wildcard: the []. Use:
- - [abc]* matches files starting with a, b, c;
- - [I-N]* matches files starting with I, J, K, L, M, N.
- 7) there is no DOS-like RENAME; that is, ren *.xxx *.yyy won't work.
-
- 1.3. Executing Programs: Multitasking and Sessions
-
- To run a program, type in its name as you would do under DOS. If the
- directory (Section 2) where the program is stored is included in the PATH
- (Section 4), the program will start. Exception: unlike DOS, under Linux a
- program located in the current directory won't run unless the directory is
- included in the PATH. Escamotage: being <prog> your program, type ./<prog>.
-
- This is what the typical command line looks like:
- $ command -s1 -s2 ... -sn par1 par2 ... parn <input >output
- where -s1, ..., -sn are the program switches, par1, ..., parn are the
- program parameters. It is possible to issue several commands on the command
- line:
- $ command1 ; command2 ; ... ; commandn
- That's all about running programs, but it's easy to go a step beyond. One
- of the main reasons for using Linux is that it is a multitasking os - it
- can run several programs (from now on, processes) at the same time. You can
- launch processes in background and continue working straight away.
- Moreover, Linux lets you have several sessions: it's like having many
- computers to work on at once!
-
- - To switch to session 1..8:
- $ <ALT-F1> ... <ALT-F8>.
- - To start a new session without leaving the current one:
- $ su - <loginname>
- Example:
- $ su - root
- This is useful, for one, when you need to mount a disk (Section 3): only
- root can do that.
- - To end a session:
- $ exit
- - To launch a process in foreground:
- $ progname [-switches] [parameters] [<input] [>output]
- - To launch a process in background, add an ampersend (&) at the end of the
- line:
- $ progname [-switches] [parameters] [<input] [>output] &
- - To see how many processes there are:
- $ ps
- This will output a list of processes currently running. Each one is
- identified by a PID, a number.
- - To kill a process:
- $ kill <PID>
- You may need to kill a process when you don't know how to quit it the right
- way... ;-). Sometimes, a process will only be killed by either one of the
- following:
- $ kill -15 <PID>
- $ kill -9 <PID>
- In addition to this, the shell (the equivalent of COMMAND.COM; most folks
- use a shell called bash) allows you to stop or temporarily suspend a
- process, send a process to background, and bring a process from background
- to foreground. In this context, processes are called "jobs".
- - To see how many jobs there are:
- $ jobs
- here jobs are identified by the numbers the shell gives them, not by their
- PID.
- - To stop a process running in foreground:
- $ <CTRL-C>
- (it doesn't always work)
- - To suspend a process running in foreground:
- $ <CTRL-Z>
- (ditto)
- - To send a suspended process into background:
- $ bg <job>
- - To bring a process to foreground:
- $ fg <job>
- - Again, to kill a process:
- $ kill %<job>
- where <job> may be 1, 2, 3, ... Using these commands you can format a
- disk, zip a bunch of files, compile a program, and unzip an archive all at
- the same time, and still have the prompt at your disposal. Try this with
- DOS! And try with Windows, just to see the difference in performance.
-
-
- Section 2: Using Directories
-
- 2.1. Directories: Preliminary Notions
-
- We have seen the differences between files under DOS and Linux. As for
- directories, under DOS the root directory is \, under Linux / is.
- Similarly, nested directories are separated by \ under DOS, by / under
- Linux. Example of file paths:
- DOS: \PROGRAMS\C++\SOURCES\HELLO.CPP
- Linux: /home/guido/papers/geology/mid_eocene.tex
- As usual, .. is the parent directory, . is the current directory. Remember
- that the system won't let you cd, rd, or md everywhere you want. Every user
- starts from his or her own directory called home, given by the system
- administrator; for instance, on my PC my home dir is /home/guido.
-
- 2.2. Translating Commands from DOS to Linux
-
- DIR: ls, find, du
- CD: cd, pwd
- MD: mkdir
- RD: rmdir
-
- - EXAMPLES -
-
- DOS Linux
-
- C:\GUIDO>dir $ ls
- C:\GUIDO>dir file.txt $ ls file.txt
- C:\GUIDO>dir *.h *.c $ ls *.h *.c
- C:\GUIDO>dir/p $ ls | more
- C:\GUIDO>dir \*.tmp /s $ find / -name "*.tmp"
- C:\GUIDO>cd $ pwd
- n/a - see note $ cd
- n/a - see note $ cd ~
- n/a - see note $ cd ~/temp
- C:\GUIDO>cd \other $ cd /other
- C:\GUIDO>cd ..\temp\trash $ cd ../temp/trash
- C:\GUIDO>md newprogs $ mkdir newprogs
- C:\GUIDO>md \progs\turbo $ mkdir /progs/turbo
- C:\GUIDO>rd newprogs $ rmdir newprogs
- C:\GUIDO>rd \progs\turbo $ rmdir /progs/turbo
-
- Note: the character ~ is a shortcut for the name of your home directory.
- The commands cd or cd ~ will take you to your home directory from wherever
- you are; the command cd ~/tmp will take you to /home/your_home/tmp. Got
- the hang of it?
-
-
- Section 3: Floppies, Hard Disks, and the Like
-
- 3.1. Using a floppy disk
-
- You have never thought about it, but the DOS command FORMAT A: does a lot
- more work than it seems. In fact, when you issue the command FORMAT it
- will:
- 1) physically format the disk;
- 2) create the A:\ directory (= create a filesystem);
- 3) make the disk available to the user (= mount the disk).
-
- These three steps are addressed separately under Linux. It is possible to
- prepare and use floppies in MS-DOS format, though other formats are
- available; the most common is perhaps ext2. Here is how to prepare a disk
- (you'll need to start a session as root):
-
- - To format a standard 1,44 Meg floppy disk (A:):
- # fdformat /dev/fd0H1440
- - To create a filesystem:
- # mkfs -t ext2 -c /dev/fd0H1440
- or
- # mformat a:
- to create an MS-DOS filesystem.
-
- Beore using the disk, you must mount it.
- - To mount the disk:
- # mount -t ext2 /dev/fd0 /mnt
- or
- # mount -t msdos /dev/fd0 /mnt
-
- Now you can address the files in the floppy. When you've finished, before
- extracting the disk you must unmount it. (*very important!*)
- - To unmount the disk:
- # umount /mnt
- Now you can extract the disk. Obviously, you have to fdformat and mkfs only
- unformatted disks, not previously used ones. If you want to use drive B:,
- refer to fd1H1440 and fd1 instead of fd0H1440 and fd0 in the examples
- above.
-
- All you used to do with A: or B: is now done using /mnt instead. Examples:
-
- DOS Linux
-
- C:\GUIDO>dir a: $ ls /mnt
- C:\GUIDO>copy a:*.* \docs\temp $ cp /mnt/* /docs/temp
- C:\GUIDO>copy *.zip a:\zip $ cp *.zip /mnt/zip
- C:\GUIDO>a: $ cd /mnt
- A:\> /mnt$
-
- Needless to say, what holds for floppies holds for whatever device you can
- think of; for instance, you may want to mount another hard disk or a CD-ROM
- drive. Have a look at the list of devices in directory /dev. Here's how to
- mount the CD-ROM:
- # mount -t iso9660 /dev/cdrom /cdrom
-
-
- Section 4: Tayloring the System
-
- 4.1. System Initialization Files
-
- Two important files under DOS are AUTOEXEC.BAT and CONFIG.SYS, which are
- used at boot time to initialise the system, set some environment variables
- like PATH and FILES, and possibly launch a program or batch file.
-
- Under Linux there are several initialisation files, some of which you had
- better not tamper with until you know exactly what you are doing. I'll tell
- you what the most important are, anyway:
-
- FILES NOTES
-
- /etc/inittab don't touch for now!
- /etc/rc.d/* ditto
-
- If all you need is setting the PATH and other environment variables, or you
- want to change the login messages or automatically launch a program after
- the login, have a look at the following files:
-
- FILES NOTES
-
- /etc/issue sets pre-login message
- /etc/motd sets post-login message
- /etc/profile sets PATH and other variables, etc.
- /home/your_home/.profile does whatever you want
-
- If the latter file exists (note that it is a hidden file), it will be read
- after the login and the commands in it will be executed.
-
- Example - look at this .profile:
-
- # I am a comment
- echo Environment:
- printenv | more # equivalent of command SET under DOS
- alias d='ls -l' # easy to understand what an alias is
- alias up='cd ..'
- echo "I remind you that the path is "$PATH
- echo "Have a good day, "$LOGNAME
-
- PATH and LOGNAME, you guessed right, are environment variables.
-
- 4.2. Program Initialization Files
-
- Under Linux, virtually everything can be tailored to your needs. Most
- programs have one or more initialization files you can fiddle with, often
- as a .prognamerc in your home dir. The first ones you'll want to modify
- are:
-
- .xinitrc: used by startx to initialize X Window System.
- .fvwmrc: used by the window manager fvwm. A sample can be found in:
- /usr/lib/X11/fvwm/system.fvwmrc
- .xfm/*: used by xfm, a file manager for X.
- .Xdefault: used by rxvt, a terminal emulator for X.
-
- For all of these and the others you'll come across sooner or later, RMP.
-
-
- Section 5: A Bit of Programming
-
- 5.1. Writing Scripts: .BAT Files on Steroids
-
- If you used .BAT files to create shortcuts of long command lines (I did a
- lot), this goal can be attained by inserting appropriate alias lines (see
- example above) in profile or .profile. But if your .BATs were more
- complicated, then you'll love the scripting language made available by the
- shell: it's as powerful as Qbasic, if not more. It has variables,
- structures like while, for, case, if... then... else, and lots of other
- features: it can be a good alternative to a "real" programming language.
-
- To write a script - the equivalent of a .BAT file under DOS - all you have
- to do is write a standard ASCII file containing the instructions, save it,
- then make it executable with the command
- $ chgmod u+x <scriptfile>
- To execute it, type in its name.
-
- A word of warning. The system editor is called vi, it's rather difficult to
- use, and I'm sure you'll find it lousy. I'm not going to explain how to use
- it, because I myself can't find my way around in it yet; see Matt Welsh's
- "Linux installation... ", page 109. You had better get hold of another
- editor like joe or emacs for X. Suffice it here to say that:
- - to insert some text, type i then your text;
- - to quit vi whithout saving, type ESC then :q!
- - to save and quit, type ESC then :wq
-
- Writing scripts under Linux is such a vast subject it would require a book
- by itself, and I will not delve into the subject any further. I'll just
- give you a few (hopefully) useful examples from which you can extract some
- basic rules.
-
- EXAMPLE 1: first_script
-
- #!/bin/sh
- # I am a comment
- # don't change the first line - it's got to be there
- echo "Today is `date`"
- echo "My name is "$0
- echo "You gave me the following "$#" parameters: "$*
- echo "First parameter is "$1
- echo "Have you grasped the trick?"
-
- EXAMPLE 2: 2exe
-
- #!/bin/sh
- echo "making "$1" executable... "
- chmod u+x $1
-
- EXAMPLE 3: backup
-
- #!/bin/sh
- echo "Copying files in ~/bak... "
- for name in $*
- do
- cp ${name} ~/bak
- done
-
- EXAMPLE 4: fmta
-
- #!/bin/sh
- echo "I remind you that only root can format disks"
- fdformat /dev/fd0H1440
- mkfs -t ext2 -c /dev/fd0H1440
- echo "disk formatted."
-
- EXAMPLE 5: mnta
-
- #!/bin/sh
- echo "I remind you that only root can mount disks"
- mount -t msdos /dev/fd0 /mnt
- echo "don't forget to umount when you've done."
-
- 5.2. C for Yourself
-
- You're not expecting to find GW/Qbasic under Linux, are you? Under Un*x,
- the system language is C, love it or hate it. Lots of other languages
- (FORTRAN, Pascal, Lisp, Basic... but not Turbo Pascal, helas) are also
- available.
-
- Taken for granted that you know C, here are a couple of guidelines for
- those of you who have been pampered by Turbo C++ or one of its DOS
- brothers. Linux's C compiler is called gcc and lacks all the bells and
- whistles that usually accompany its DOS counterparts: no IDE, on-line help,
- integrated debugger, etc. It's just a rough command-line compiler, very
- powerful and efficient. To compile your standard hello.c you'll do:
- $ gcc hello.c
- which will create an executable file called a.out. To give the executable a
- different name, do
- $ gcc -o hola hello.c
- To link a program with a library, add the switch -l<arg>. For example, to
- link the math library do
- $ gcc -o mathprog mathprog.c -lm
- (The -l<arg> switch forces gcc to link the library /usr/lib/lib<arg>.a; so
- -lm links /usr/lib/libm.a).
-
- All this is good for small programs. But when your prog is made of several
- source files, you'll need to use the utility make. Let's suppose you have
- written an expression parser: its source file is called parser.c and
- #includes two header files, parser.h and xy.h. Then you want to use the
- routines in parser.c in a program, say, calc.c, which in turn #includes
- parser.h. What a mess! What do you have to do to compile calc.c?
-
- You'll have to write a so-called makefile, which tells the compiler the
- dependencies between sources and objects files. In our example:
-
- # This is makefile, used to compile calc.c
- # Press the <TAB> key at appropriate positions!
-
- calc: calc.o parser.o
- <TAB>gcc -o calc calc.o parser.o -lm
- # calc depends on two object files: calc.o and parser.o
-
- calc.o: calc.c parser.h
- <TAB>gcc -c calc.c
- # calc.o depends on two source files
-
- parser.o: parser.c parser.h xy.h
- <TAB>gcc -c parser.c
- # parser.o depends on three source files
-
- # end of makefile.
-
- Save this file as makefile and then type
- $ make
- to compile your program; alternatively, save it as calc.mak and then type
- $ make -f calc.mak
- And of course, RMP.
-
- In addition to all this, remember that you can invoke some help about the C
- functions, which are covered by man pages; for example,
- $ man printf
-
-
- Section 6: The Remaining 1%
-
- 6.1. Unroot Yourself
-
- It's a very bad idea to login as root to do everyday work; such account is
- dangerous and should be used for system administration only. To give
- yourself a new account, login as root and issue the command
- # adduser
- entering then the information the system will ask you. (Enter <RET> to the
- questions you don't understand; default values will be used.)
-
- 6.2. Making Virtual Memory
-
- Although Linux can theoretically run with only 2 megs of RAM, the more you
- have, the more you can do. X Window System won't run unless you have at
- least 8 megs. To create an additional 8 megs of virtual memory, type as
- root:
- # dd if=/dev/zero of=/swapfile bs=1024 count=8192
- # mkswap /swapfile 8192
- # sync
- # swapon /swapfile
- Add the last line in /etc/rc.d/rc.local to make the swapfile available the
- next time you boot.
-
- 6.3. Using tar & gzip
-
- Under Un*x there are some widely used applications to archive and compress
- files. tar is used to make archives - it's like PKZIP but doesn't compress,
- it only archives. To make a new archive:
- $ tar -cvf <archive_name.tar> <file> [file...]
- To extract files from an archive:
- $ tar -xpvf <archive_name.tar> [file...]
- To list the contents of an archive:
- $ tar -tf <archive_name.tar> | less
- You can compress files using compress, which is obsolete and shouldn't be
- used any more, or gzip:
- $ compress <file>
- or:
- $ gzip <file>
- that creates a compressed file with extension .Z (compress) or .gz (gzip).
- These programs can compress only one file at a time. To decompress, use
- $ compress -d <file>
- or
- $ gzip -d <file>
- RMP.
-
- The arj, zip and unzip (PK??ZIP compatible) utilities are also available.
- Files with extension .tar.gz or .tgz (archived with tar, then compressed
- with gzip) are as common in the Un*x world as .ZIP files are under DOS.
- Here's how to list the contents of a .tar.gz archive:
- $ gzip -dc <file.tar.gz> | tar tf - | less
-
- 6.4. Installing Applications
-
- Most Linux applications are distributed as .tar.gz archives, specifically
- prepared so that they can be decompressed from / typing the following
- command:
- # gzip -dc <file.tar.gz> | tar xvf -
- The files will be decompressed in the right directory, which will be
- created on the fly. Great, isn't it? Users of the Slackware distribution
- (and perhaps other distributions - I don't know) have a user-friendly
- pkgtool program, though.
-
- Others packages have their own installation instructions; read the
- documentation. Besides, some packages are distributed as C or C++ source
- files, which you'll have to compile to create the binaries. In most cases,
- all you have to do is issue
- # make
- Obviously, you'll need the gcc compiler, included in most distributions.
- And remember that installing packages is root's work.
-
- 6.5. Tips You Can't Do Without
-
- Command completion: pressing <TAB> when issuing a command will complete the
- command line for you. Example: you have to type gcc this_is_a_long_name.c;
- typing in gcc thi<TAB> will suffice. (If you have other files that start
- with the same characters, type enough characters to resolve any ambiguity.)
-
- Backscrolling: pressing SHIFT + PAG UP (the grey key) allows you to
- backscroll a few pages, depending on how much video memory you have.
- Moreover, if you issue the command
- $ script <script_file>
- everything that appears on screen until you issue the command exit will be
- copied to the file script_file, which you can examine later on.
-
- Resetting the screen: if you happen to more or cat a binary file, your
- screen may end up full of garbage. To fix things, blind type
- $ reset
- or this sequence of characters: echo CTRL-V ESC c RETURN.
-
- Messages from the kernel: have a look at /var/adm/messages as root to see
- what the kernel has to tell you, including bootup messages.
-
- 6.6. Useful Programs
-
- First of all, where to find them. Since you all know how to surf the Net
- and how to use archie and ftp, I'll just give you three of the most
- important addresses for Linux: sunsite.unc.edu, TSX-11.mit.edu, and
- nic.funet.fi. Please use your nearest mirror.
-
- at allows you to run programs at a specified date and time;
-
- delete-undelete do what their name means;
-
- df gives you info about the hard disk(s);
-
- dosemu allows you to run several (not all) DOS programs - including Windows
- 3.x, with a bit of fiddling;
-
- file <filename> tells you what a file is (ASCII text, executable, archive,
- etc.);
-
- find (see section 2.2) is one of the most powerful and useful commands. It
- can be used to find files that match several characteristics and perform
- actions on them. General use of find is:
- $ find <directory> <expression>
- where <expression> includes search criteria and actions. Examples:
- $ find . -type l -exec ls -l {} \;
- finds all the files that are symbolic links and show what they point to.
- $ find / -name "*.old" -ok rm {} \;
- finds all the files matching the pattern and deletes them, asking for your
- permission first.
- $ find . -perm 755
- finds all the files whose permissions match 755 (executable).
- $ find . -user root
- finds all the files that belong to root.
- Lots of possibilities here - RMP.
-
- grep finds text patterns within files. For example,
- $ grep -l "geology" *.tex
- lists the files *.tex that contain the word "geology". RMP;
-
- gzexe compresses executable binaries keeping them executable;
-
- joe is an excellent editor. Invoking it by typing jstar you'll get the same
- key bindings as WordStar and its offspring, including the DOS editor;
-
- lpr <file> prints a file in background. To check the status of the printing
- queue, use lpq;
-
- mc is a very useful file manager;
-
- pine is a nice e-mailing program;
-
- sudo allows users to perform some of root's tasks (e.g. formatting and
- mounting disks; RMP)
-
- uname -a gives you info about your system;
-
- zcat and zless are useful for viewing gzipped text files without ungzipping
- them. Possible use:
- $ zless textfile.gz
- $ zcat textfile.gz | lpr
-
- 6.6. Common Extensions and Related Programs
-
- You may come across scores of file extensions. Excluding the more exotic
- ones (i.e. fonts, etc.), here's a list of who's what:
-
- .1 ... .8: man pages. Get man.
- .arj: archive made with arj.
- .dvi: output file produced by TeX (see below). xdvi to visualize it; dvips
- to turn it into a postscript .ps file.
- .gif: graphic file. Get seejpeg or xpaint.
- .gz: archive made with gzip.
- .info: info file (sort of alternative to man pages). Get info.
- .jpg,.jpeg: graphic file. Get seejpeg.
- .ps: postscript file. To visualize it get gs and, optionally, ghostview.
- (great!)
- .tgz,.tar.gz: archive made with tar and compressed with gzip.
- .tex: text file to submit to TeX, a powerful typesetting program. Get the
- package tex, available in many distributions.
- .texi: texinfo file (cp. .info). Get texinfo.
- .xbm,.xpm,.xwd: graphic file. Get xpaint.
- .zip: archive made with zip. Get zip and unzip.
- .Z: archive made with compress.
-
-
- The End, for Now
-
- Congratulations! You have now grasped a little bit of Un*x and are ready to
- start working. Remember that your knowledge of the system is still
- positively limited, and that you are expected to do more practice with
- Linux to use it comfortably. But if all you had to do was get a bunch of
- applications and start working with them, I bet that what I included here
- is enough: by now I don't know much more, yet I manage to work with Linux
- every day!
-
- I'm sure you'll enjoy using Linux and will keep learning more about it -
- everybody does. I bet, too, that you'll never go back to DOS! I hope I made
- myself understood and did a good service to my 3 or 4 readers.
-
-
- Disclaimer
-
- "From DOS to Linux - Quick!" was written by Guido Gonzato,
- <Guido@ibogfs.cineca.it>, April 1996. Many thanks to Matt Welsh, the author
- of "Linux Installation and Getting Started", to Ian Jackson, the author of
- "Linux frequently asked questions with answers", to Giuseppe Zanetti, the
- author of "Linux - Il sistema operativo FREE SOFTWARE per personal computer
- 386/486", to all the folks who emailed me suggestions, and especially to
- Linus Torvalds and GNU who gave us Linux.
-
- This document is provided "as is". I put great effort into writing it as
- accurately as I could, but you use the information contained in it at your
- own risk. In no event shall I be liable for any damages resulting from the
- use of this work.
-
- This document can be freely distributed as long as:
-
- - it is distributed in its entirety, including this disclaimer and
- permission notice;
- - no money is charged for it;
- - it is not modified in any way without my permission.
-
- Translations, prints, re-editings, or extractions from this document must
- be approved by me before being distributed. For any requests, suggestions,
- flames, etc., feel free to contact me. If you don't have e-mail access, my
- snail-mail address is:
-
- Guido Gonzato - Via Monte Ortigara 19/a, 37127 Verona - Italy
-
- Enjoy life!
-
- Guido =8-)
-
-