computer systems 2009-2010 week 11: the command line interface alma whitfield

38
Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

Upload: arron-mckenzie

Post on 04-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

Computer Systems

2009-2010

Week 11: The Command Line Interface

Alma Whitfield

Page 2: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

2

What we have done so far Files organised into directories Directories form a hierarchy Manipulated files using Windows

Windows Explorer

Page 3: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

3

What we are going to do today Examine the MS-DOS operating

system’s command line interface

Look at how MS Windows has developed from MS-DOS

Page 4: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

4

Organising files Thousands of files can be held in

secondary storage Organising the files is a job for the

operating system

Page 5: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

5

Operating systems An operating system is software

installed on the computer to make it possible to use it without needing a degree in electronic engineering

Page 6: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

6

Operating systems: mini-history Early machines had no operating

system – you needed to be an engineer to run a program Could only run one program at a time The CPU spent most of its time waiting

for hardware to complete tasks like printing or writing to or reading from disc

Page 7: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

7

Operating systems: mini-history By the 1960s, operating systems

could run several programs at the same time While one program is waiting for a read

from disc, another could be executing

Page 8: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

8

Operating systems: early 1980s Microsoft introduced PC operating

system called MS-DOS Microsoft Disc Operating System Disc operating system means file

organisation Instructions typed in at a command

line

Page 9: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

9

Operating systems: early 1980s Microsoft introduced PC operating

system called MS-DOS Microsoft Disc Operating System Disc operating system means file

organisation Instructions typed in at a command

line

Page 10: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

10

MS-DOS uses a Command Line Interface Do not use mouse Type in commands as words

i.e. lines of command Use a Command Prompt box

Start | Programs | Accessories | Command

Prompt Demo

Page 11: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

11

Entering MS-DOS commands Commands consist of

A single word Optional extra information e.g. c:\>ver

c:\>ping www.playboy.com

c:\>ping www.bbc.co.uk

Page 12: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

12

The current directory When using MS-DOS, it always places you

in a directory “Everybody has got to be somewhere” (Eccles

– the Goon Show – circa 1954) This is called the Current Directory The command prompt tells you what the

current directory is E.g. c:\windows\temp> …. means current directory is \windows\temp

on the c: drive

Page 13: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

13

Finding out what is in the current directory Use the dir command

E.g. c:\>dir

Page 14: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

14

Disc information

Page 15: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

15

Directory name

Page 16: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

16

Information about the files

in this directory

Page 17: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

17

Date and time file last changedp = pma = am

Page 18: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

18

<DIR> indicates these two items are directories

Page 19: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

19

This file is named win2k.xprIt is 189,624 bytes in size

Page 20: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

20

Total size of files in this directoryNumber of bytes still available on

the disc

Page 21: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

21

Changing drive in MS-DOS Demo Use drive name (A:, C: etc)

Page 22: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

22

File handling in MS-DOSCreate and edit text files edit

Display text files type

Change current directory cd

Make a new directory md

Remove a directory rd

Copy files from one directory to another directory

copy

Page 23: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

23

Using edit Demo Creating text files Editing text files

Page 24: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

24

Using copy Demo Using wildcards in copying c:\>copy *.txt c:\temp c:\>copy *.* c:\temp

Page 25: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

25

Using md to make directories Demo Building this directory structure c:\>md D c:\>md A c:\>cd D c:\D>md B c:\D>cd \ c:\>cd A c:\A>md D

Page 26: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

26

Using cd Demo Moving up one level c:\>cd A c:\A> c:\A>cd .. c:\>

Page 27: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

27

Using cd with absolute and relative paths Absolute path:

starts with root c:\>cd \A\D c:\A\D> Relative path: starts

from current directory

c:\A\D>cd ..\..\D c:\D>

Page 28: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

28

Batch files Batch files Collecting batches of commands

into one command Like a macro in other applications

e.g. Word, Excel

Page 29: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

29

A batch file example What directory

structure does this batch file create:

cd \

md A

md B

cd A

md C

Page 30: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

30

A second batch file example Write a batch file to

create this directory structure: cd \

md A

md B

md C

cd B

md D

Page 31: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

31

A third batch file example Write a batch file to

create this directory structure: cd \

md D

md A

cd D

md B

cd \A

md D

Page 32: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

32

Operating systems: early 1980s Apple Inc introduced first operating

system with a Graphical User Interface (GUI) Apple Lisa Apple MacIntosh Instructions issued using mouse clicks

on menus, and buttons

Page 33: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

33

Operating systems: early 1980s

Page 34: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

34

Operating systemsMicrosoft Windows family of operating

systems Windows Windows 95 Windows 98 Windows 2000 Windows XP Vista

Page 35: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

35

Page 36: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

36

A brief survey of Microsoft Windows Operating Systems http://www.youtube.com/watch?v=y48rthTbrA8

Also - flv file present locally

Page 37: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

37

Microsoft Windows has two streams Graphical front end to MS-DOS

Windows Windows 95 Windows 98

Not based on MS-DOS Windows 2000 Windows XP Vista

Streams look the same but completely different inside

A brief survey of Microsoft Windows Operating Systems

Page 38: Computer Systems 2009-2010 Week 11: The Command Line Interface Alma Whitfield

38

Other PC Operating Systems Linux operating systems

Red Hat Linux SuSE Linux Mandrakesoft Linux etc

Competitor to Microsoft Based on Unix operating systems Originally had only command line

type interfaces Recent developments provide

graphical front ends