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

Files

In UNIX, you are able to create, delete and edit files, but before attempting to perform such operations on your files, you may need to check which files you have at the moment. The command to do this is ls (list). If you have only just started to use the UNIX system, you should not have created any files (although there may also be 'hidden' files, which we will discuss later). If you type ls on its own, this should be confirmed when nothing is printed in response, so:

ls
$

You will need to create and update files containing text (for example, programs written in Java, Pascal or C, or word-processed reports). There are many simple to use editors available, and Windows users will probably be familiar with Microsoft Word and with Notepad. These are fine for modifying small amounts of text, but are cumbersome if large files are involved, or if repeated changes have to be made. We look in this section at editors which are available under UNIX, and which are suitable for heavy use. In particular, we introduce the standard UNIX editor Vi, which may at first sight seem relatively tricky to use. Fear not! The skills you will gain in later chapters will feed back into use of Vi, and allow you to make complex changes to a file quickly and easily. We also discuss the other options available to you if you prefer at this stage to use an editor which is more straightforward for simpler use.


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck