Comp 1402 Winter 2008 Tutorial #1 Tutorial 1 The objectives of - - PDF document

comp 1402
SMART_READER_LITE
LIVE PREVIEW

Comp 1402 Winter 2008 Tutorial #1 Tutorial 1 The objectives of - - PDF document

Comp 1402 Winter 2008 Tutorial #1 Tutorial 1 The objectives of this tutorial will be: Create and access your Linux account. Become familiar with the Linux terminal. Become familiar with the vi text editor. Compile a


slide-1
SLIDE 1

1

Comp 1402

Winter 2008 Tutorial #1

Tutorial 1

  • The objectives of this tutorial will be:

– Create and access your Linux account. – Become familiar with the Linux terminal. – Become familiar with the vi text editor. – Compile a simple C program.

slide-2
SLIDE 2

2

Part I: Creating SCS Account Linux Account

  • To create a new account

– Login as newacct with no password.

  • Creating a linux account

– http://www.scs.carleton.ca/nethelp/zeta/zeta.s html#ACCOUNT

Updating Your Account

slide-3
SLIDE 3

3

Part II: Login To Linux

  • Select SCS Linux Network
  • Select a Linux Host (Zeta0 … Zeta15)
  • Login to Linux System

– You will be required to re-enter your SCS username and password.

  • Start Terminal in Linux

Starting Linux Terminal

  • You will do most of your work this term in

the Linux terminal (command line)

  • From the main menu (Federa ‘f’) select:
  • Accessories -> Terminal
  • For those of you familiar with UNIX/Linux

sorry this will all be review for you ...

slide-4
SLIDE 4

4

Basic Shell Commands

(Covered in this tutorial)

  • ls

– List all files in the current directory (folder )

  • pwd

– Show the path to the current directory.

  • cd

– Change directories

  • mkdir

– Create a new directory

Basic Shell Commands

(Continued)

  • rm

– Remove files or directories

  • rmdir

– Remove a directory

  • more

– List contents of a (text) file

  • man

– help for commands

slide-5
SLIDE 5

5

Part II VI Text Editor

The VI Text Editor

  • Vi (“vee eye”) is a basic but powerful

screen based (no fancy GUI) text editor.

  • One of many available, but you will get to

use it for your first tutorial!

  • Vi is a screen based editor which operates

in one of two modes:

– Command Mode – Text Entry Mode

slide-6
SLIDE 6

6

Command Mode

  • vi has no GUI so all operations are

performed from keyboard.

  • Commands are typed from keyboard, for

example:

– dw – deletes the word at the cursor – dl – deletes the current line – :wq – save file and quit.

  • You cannot type text while in Command

Mode.

Text Entry Mode

  • Whatever you type while in Text Entry Mode

appears in your document.

  • To switch to text input mode you use:

– i - will switch to text mode and allow typing at cursor. – a – will switch to text mode and allow typing at character immediately after cursor.

  • You can use arrows keys to navigate while in

text entry mode.

  • The ‘Esc’ key will return you to Command Mode.
slide-7
SLIDE 7

7

Part III: GCC Compile

Introduction to GCC

  • For this tutorial you will be compiling a

very simple C program.

  • GCC takes one (or more) C source files

and generates an executable program that you can execute from the terminal.

  • For the tutorial you will be expected to

generate a program the prints “Hello World”.

slide-8
SLIDE 8

8

Have Fun