computer systems 2009-2010 week 11: the command line interface alma whitfield
TRANSCRIPT
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
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
4
Organising files Thousands of files can be held in
secondary storage Organising the files is a job for the
operating system
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
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
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
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
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
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
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
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
13
Finding out what is in the current directory Use the dir command
E.g. c:\>dir
14
Disc information
15
Directory name
16
Information about the files
in this directory
17
Date and time file last changedp = pma = am
18
<DIR> indicates these two items are directories
19
This file is named win2k.xprIt is 189,624 bytes in size
20
Total size of files in this directoryNumber of bytes still available on
the disc
21
Changing drive in MS-DOS Demo Use drive name (A:, C: etc)
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
23
Using edit Demo Creating text files Editing text files
24
Using copy Demo Using wildcards in copying c:\>copy *.txt c:\temp c:\>copy *.* c:\temp
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
26
Using cd Demo Moving up one level c:\>cd A c:\A> c:\A>cd .. c:\>
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>
28
Batch files Batch files Collecting batches of commands
into one command Like a macro in other applications
e.g. Word, Excel
29
A batch file example What directory
structure does this batch file create:
cd \
md A
md B
cd A
md C
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
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
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
33
Operating systems: early 1980s
34
Operating systemsMicrosoft Windows family of operating
systems Windows Windows 95 Windows 98 Windows 2000 Windows XP Vista
35
36
A brief survey of Microsoft Windows Operating Systems http://www.youtube.com/watch?v=y48rthTbrA8
Also - flv file present locally
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
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