UN*X Course

Ardo Illaste, Pearu Peterson, Marko Vendelin

This course is developed for giving a basic knowledge of working in the UN*X-like environments with the emphasis on the scientific applications. The course is divided into 9 thematic sections, each section ends with a test. It is advised to pass a test of each particular section before starting to work with material of the next section. The course is counted as read, when all 9 tests are passed.


1  Looking for Information on Linux
1.1  Material
1.2  Test
2  Basic UN*X
2.1  Material
2.2  Test
3  Publishing
3.1  Material
3.2  Test
4  X11
4.1  Material
4.2  Test
5  Applications 1
5.1  Material
5.2  Test
6  Applications 2
6.1 Material
6.2 Test
7  Applications 3
6.1 Material
6.2 Test
8  Program Installation
9  Linux Installation and Kernel Recompilation
9.1 Material
9.2 Test

1  Looking for Information on Linux

1.1  Material

  1. Introductory comments and description of the information sources are described in Linux Installation and Getting Started, chapter 1. Read it by issuing the following command in the terminal window acroread install-guide-3.2.pdf.
  2. You will find many useful tips and tricks in Linux Users Guide. Look into the chapters 1 and 2 of this nice book.
  3. The information about Linux commands can be obtained by using man command. Try to run man man in the terminal. Read the manual page.
  4. Learn how to use Firefox by exploring its Help. Pay attention to bookmarks usage.
  5. Useful Internet site with Linux information is http://www.linux.org . Explore this page. Take a look at http://www.linux.com .
  6. One of many Internet search sites is http://www.google.com . Go to it and read the help located on this site. Learn how to use simple and advanced search. Now you should know how to look for the information in the Internet. Try to find answer to the question which has puzzled you the whole your life.

1.2  Test

For this test you must be able to find information from the books, Linux sites, Internet search sites, and the system man-pages. You must be familiar with the basic usage of Firefox browser. During a test you will answer the following questions.

  1. What is Linux?
  2. Who invented Linux?
  3. How to pronounce “Linux”?
  4. What is Free Software? Compare it with free beer and freedom.
  5. What is Open Source?
  6. What is GNU? What is GPL? What does it give to you and tell which limitations GPL imposes on you? What is BSD?
  7. Put all your favorite web-sites into Firefox bookmarks.
  8. What does the command top?
  9. What people think about Estonian weather? Find out in Google.
  10. Find all pages with both Linux and FreeBSD. How many pages you have found? Do the same for words Microsoft and Windows.
  11. You will find the answer to the question that has puzzled us (come up and ask).

2  Basic UN*X

2.1  Material

  1. Read sections 4 and 6 at Linux Users Guide. Read the section Linux Tutorial at Linux Installation and Getting Started.
  2. Test all the marked commands given at “UNIX Quick Reference” card (find it from the internet) and the commands listed in section 2.2 below.
  3. Learn how to use Midnight Commander (mc) by reading its man-page. Learn what function keys do.
  4. Find info about the file permissions, typical unix directory tree, mount command, and /etc/fstab file. Mount and unmount an usb drive on your terminal. Read about the NFS at NetworkFileSystem.html
  5. Start emacs. Read and follow the Linux Users Guide, chapter 8. Run the tutorial in Emacs by pressing C-h t and go through it. Test emacs commands marked at the GNU Emacs Reference Card. Look into the file ~/.emacs. What are emacs modes?
  6. Find and understand the bash shell manual at http://www.gnu.org until the section Job Control, and have a look at http://unixhelp.ed.ac.uk/scrpt/scrpt2.html . Try to write a bash shell script that does something useful. For this, use existing scripts as examples.

2.2  Test

For this test, you must be familiar with all the marked commands at the UNIX Quick Reference card, and with the following commands: env, lynx,ssh,scp,rsync. You must be able to use effectively the following commands: rgrep, find, top,wc wget, tar, gzip, bzip2,unzip. You must know, what is UN*X shell. You must know what are processes, redirection, piping, job control (background, foreground, signalling), .bashrc and .bash_profile files, and environment variables (PATH, PS1, TERM). You must be able to write bash shell scripts containing looping and conditional constructs. You must know the networked file system of our cluster. You must be able to mount USB drive to your local terminal.

At test:

  1. You will be asked to fully explain any of the command lines given in the document sysadmins.html
  2. You will be asked to fully explain the useful shell script written previously by you (see previous section).
  3. Run Firefox, find any page with a nice picture, and print it out on our local printer (Xerox)

3  Publishing

3.1  Material

  1. Read L. Lamport’s book LATEX – A Document Preparation System – User’s Guide and Reference Manual chapters 1-4, 6, and appendix B.
  2. To write conveniently in LATEX, explore the emacs package Auctex. The online documentation can be found at http://www.gnu.org/software/auctex/manual/auctex.html . The printable documentation is on files auc-tex.dvi, tex-ref.dvi, and math-ref.dvi. Find these.
  3. To get convenient referencing, explore the emacs packages RefTeX and Natbib. Documentation is at http://www.xemacs.org/Documentation/packages/html/reftex.html andnatbib.dvi.
  4. Find the description of emacs packages fontenc and babel.
  5. From Latex manual or elsewhere find a brief description of the Encapsulated Postscript graphics files. Make clear what is the BoundingBox comment. A tutorial on PostScript can be obtained from Pearu.
  6. As an alternative to points 1-4 learn how to use LyX with referencing using BibTeX

3.2  Test

For this test, you must be able to write in emacs, using the Auctex package, the well-formatted technical texts that include formulas, tables, figures with PostScript graphics, table of contents, and list of references. You must be able to edit the BoundingBox of a postscript file. You must be able to write a bib file, get citations conveniently into your latex documents, switch between numerical and author-year citation styles, and generate list of references of various order and styles. You must be able to mix Estonian and English text with correct automatic hyphenation for both languages. For LyX users, figure out how to do similar tasks.

For test, you will be given a printed document with a text including figures and few references, an unformatted ascii text of the printout, and postscript files containing the figures (see below). Your task is to insert latex commands into the ascii text so that your printout will resemble as much as possible the original printout handed to you. List of references must be generated with bibtex.

Test files:

Gzipped postscript
http://cens.ioc.ee/courses/unix/testdoc.ps.gz (This is how the final version of test paper should look like)
Ascii text
Postscript figures
http://cens.ioc.ee/courses/unix/testdocfigs.tgz . It contains postscript files
introill._ps, kpsoliton.ps, [invpr4_poslabs._ps, invpr4_neglabs._ps], [posint._ps, negint._ps], A12kp._ps, invfinaleq._ps, and sensip_neg_15._pscorresponing to figures 1, 2, …, 6, and 7, respectively.
NOTE: Files with extension ._ps cannot be viewed directly as they are outputs of MetaPost program (mpost) containing incomplete font information for postscript viewers. These figures become viewable after they are included to LATEX document which then is compiled and transformed into the postscript format. File kpsoliton.ps has also misplaced bounding box that you should fix in order to pass this test.

4  X11

4.1  Material

  1. Read X Window sections at Linux Users Guide and Linux Installation and Getting Started, and An Introduction to X11 User Interfaces ( Xtut.ps ).
  2. Read X man pages. In particular, learn the usage (where, when, how) of the following programs: xterm (rxvt), xdm, xauth, xhost, xrdb, xset, xsetroot, xmodmap, xclock,xwd, xwud, xmag, Xserver, rstart, xon, xkill,xbill, etc. Study the examples and run them if possible.
  3. Read X Window User HOWTO found in LDP Homepage. Follow the links in the “Window Manager” section in order to learn for more details about window managers and desktop environments (fvwm2, kde, gnome, enlightenment, etc). Read also their manual pages if available.

4.2  Test

For this test you must be skilled in starting an X server, switching between window managers, changing the default settings of your X window environment, and using programs that X window offers.

  1. Demonstrate how to start an X server contacting a display manager at remote host (say, kev if you are in the computer class).
  2. Find out what configuration (dot) files at your home directory are read as X server starts and user logs in. Sketch a diagram.
  3. Choose a window manager (not your default one) and demonstrate how to switch to it. Point out some of the differences between various window managers: what you like/dislike in particular window manager/environment?
  4. You will make changes to your X window environment configuration (come and ask).
  5. Where are defined default X resources for various applications? Please override some of them (e.g. colors for xterm or emacs).
  6. Where the keyboard keys of your current X configuration are defined? Redefine some key of your keyboard or fix bugs that your current keyboard setup has (are you able to type Õ in emacs?).

5  Applications 1

5.1  Material

  1. In your favourite mail program, create your personal mail signature. Compose your personal addressbook as well.
  2. Fire up inkscape. Learn how to use the program by reading its “How-to Guide” located under the button “Help”
  3. Find how to use display from its documentation in system or Internet.
  4. Run acroread and look into its tutorial by pressing Help and taking look into Online Guide.

5.2  Test

For this test you must be able to use (1) inkscape for drawing schemes, saving them, and exporting them into (Encapsulated) PostScript format; (2) Your mail program for reading and sending emails with/without attachments; (3) printing facilities of the Acroread.

  1. Send an email to yourself and its “carbon copy” to Pearu, reply to it, and forward the result to Pearu.
  2. Export this mail into a file.
  3. Send the exported file with an attachment to both to yourself and to Pearu simultaneously.
  4. Draw the diagram of the file system of our cluster showing the remotely mounted directories using inkscape.
  5. Print the page with UN*X shortcuts in Acroread’s Online Guide.
  6. Explain shortly the purpose of the following packages: gimp, metapost (ask Pearu for references), python, tcl/tk.

6  Applications 2

6.1  Material

  1. Start matlab. Run demo in Matlab and look what it can do. Look into the help by giving command helpdesk in matlab shell. See the same helpdesk also athttp://cens.ioc.ee/local/man/matlab/helpdesk.html .
  2. Start xmaple. Run its tutorial.
  3. Start locally the Data Explorer (dx). Get QuickStart Guide from Marko (or at http://www.opendx.org/support.html ) and follow the tutorial. Pay attention to 3-dimensional data visualization.

6.2  Test

For this test you must know how to make (1) 2D plots in Matlab; (2) elementary transformations in Maple; (3) 3D data visualization in Data Explorer.

  1. Matlab: Plot graphs of y = 1/x2 and y = sin(x)/x into the same axes, label the axes, write some text into the middle of the figure, change the font size of the labels, add the legend of line types, and export the figure to postscript file. Now write callable matlab functions (.m files) for y = 1/x2 and y = sin(x)/x, and write a matlab script that produces the above figure and its export to postscript. Print it.
  2. Maple: Find analytically the first derivative of y = cosx, plot it, and export the figure to postscript. Print it.
  3. DataExplorer: Load the data from tutorial directory and plot the isosurface together with slice plane. Save the plot into PostScript and save the composed visual program. Print it.

7. Applications 3

7.1 Material

  1. Version control with subversion. Use wikipedia to find out what version control is. Read and do the examples from chapters 1 and 2 in the subversion book:http://svnbook.red-bean.com/en/1.5/svn-book.html.You can also look up subversion programs with graphical user interfaces: RapidSVN(Linux + Mac) and TortoiseSVN(Windows)
  2. Running programs on Tallinn University of Technology computational cluster.

7.2 Test

  1. Demonstrate that you know how to create/check out a subversion repository and know basic usage commands to add, remove, check in, update, merge and diff versioned files.
  2. Submit a job to the cluster and show how to send array jobs, set environmental variables, direct output, request resources and monitor your jobs

8  Program Installation

Select any program or package you like to have in the system, download its source code, read how to install it from its documentation, compile and install the program into your home directory. For test, you must demonstrate how the installed program works.

9  Linux Installation and Kernel Recompilation

9.1  Material

  1. Use Google to learn how to install Ubuntu Linux.
  2. Kernel compilation info can be found from file http://www.kernel.org/doc/readme/README .

9.2  Test

For this test, you must know how to install Linux, recompile and install new linux kernel. You can do this test together with your friend.

  1. Install Linux workstation with configured X and running web-server.
  2. Install Linux kernel source into your new system. Recompile the Linux kernel without MS-DOS filesystem support in it. Install new kernel.