Main index

Introducing UNIX and Linux


Getting started

Overview
Using UNIX
      Usernames
      Logging in
Logging out
Commands
      Typing in commands
      Commands and options
Communication with other users
      Email
      Other communication facilities
Files
      The editor Vi
            Vi commands (command mode)
            Vi commands (colon mode)
      Other editors
Input and output
      Scripts
      Here-documents
      Pipes
      Making copies of input and output
      Pagers
Emergencies
Getting help
Summary
Exercises

Exercises

  1. Which command will print out just your login name? Hint: try keywords for man.

    View solution

  2. Using Vi, create a file called Parone, which contains the following paragraph. Make sure you correct any typing mistakes you make.

    The Moving Finger writes, and, having writ,
    Moves on: nor all thy Piety nor Wit
    Shall lure it back to cancel half a Line,
    Nor all thy Tears wash out a Word of it. 
    
    [from the Rubaiyat of Omar Khayyam (1048-1131)]
    
  3. What argument would you give to date so that it would give today's date and time in the format:

    11:22:35 PM on Tuesday 4 December 2001

    View solution

  4. Suppose you have a file called important; using a single-line command, make two copies, one in file backup1 and the other in file backup2. Hint: this can be done in several ways.

  5. Write a script that will list the users currently logged in to the system preceded with a one-line message:

    The following are logged in:

    View solution

  6. You are editing a file using Vi. You realise that you have mis-spelled the word vision as cision. What keystrokes could you use to correct the mistake?


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck