+ All Categories
Home > Documents > 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface...

1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface...

Date post: 23-Dec-2015
Category:
Upload: douglas-watson
View: 222 times
Download: 0 times
Share this document with a friend
Popular Tags:
56
1 Command Line Interface
Transcript
Page 1: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

1

Command Line Interface

Page 2: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

2

Lecture Objectives

Explain the operation of the command line interface

Execute fundamental commands from the command line interface

Manipulate files and folders from the command line

Page 3: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

3

How does the Command Line Work?

Similar to Instant Message conversation with computer

The prompt indicates that the computer is ready to receive a command

Command is typed and ENTER is pressed PC executes command Prompt is displayed, indicating that the

computer is waiting for the next command

Page 4: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

4

Accessing the Command Line

Run dialog box Start menu under Programs | Accessories

– Win 9x/Me link is named MS-DOS prompt– Win NT, 2000, XP link is called Command Prompt

To close command line interface– Type Exit at command line and press enter– Close the window

Page 5: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

5

Command Prompt

VERY IMPORTANT:The command prompt is always focused on a specific

folder.

Any commands executed are performed on the files in the folder on which the prompt is focused.

Examples: C:\> root directory of C: drive

C:\Diploma\APLUS>

You must focus the prompt on the drive and folder where you want to work

Page 6: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

6

Filenames and File Formats

In Windows, each program and piece of data is stored as an individual file

Each file has a name, stored with the file on the drive

Names have 2 parts: filename and extension

Page 7: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

7

Eight-dot-Three naming system

File name cannot be more that 8 chrs Extension can be up to 3 chrs, OPTIONAL Following chrs cannot be used in filename

or extension:– / \ [ ] | = + ; , * ? And division symbol

Page 8: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

8

Windows naming rules

All versions starting with Win 9x are not limited be 8.3

Filenames up to 255 chrs Win 9x has backward compatibility with

DOS by creating 2 names for every file, 8.3 name and a long file name if necessary

Page 9: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

9

File extensions

Describes the type or function of the file COM = command, EXE = executable Anything that is not a program is a data file used

by a program Extension of a data file indicates which program

uses that data file .DOC = MSWord, .PPT = PowerPoint Graphic file extensions represent the graphic

standard used to create the image .JPEG =Joint Photographic Experts Group

Page 10: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

10

File Formats

All files stored on hard drive in binary format Every program is unique in the way it reads and

writes this binary data Each unique way of binary organization is known

as a file format One program cannot read another programs files

unless it can convert the other programs format

Page 11: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

11

Drives and Folders

To execute commands from the command line, must focus the prompt at the specific drive and folder that contains the files or program with which you want to work

At boot, Win assigns letters to drives and drive partitions

Page 12: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

12

Hierarchical Directory Tree

All files are put in groups called folders Any file not in a folder within the tree is

said to be in the root directory A folder inside another folder is called a

subfolder Any folder can have multiple subfolders

Page 13: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

13

Hierarchical Directory Tree

Hard drive is represented by C: Root directory is indicated by \, C:\ Subdirectories/Subfolders are indicated

by adding \ and the directory name Exact location of a file is known as its

PATH

Page 14: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

14

Fundamental Commands

ALL commands use similar structure and execute in the same way

Name of command , target of command followed by any switches (extra numbers or letters at the end)

Typing the command followed /? Displays help menu describing syntax and possible switches

Page 15: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

15

DIR Command

Contents of the directory where the prompt is focused

Lists the following:– Filename– Extension– File size in bytes– Creation date/time

DIR/W command shows you only the file names DIR/? Shows the help menu

Page 16: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

16

CD Command (Directories)

Change focus of command prompt to a different directory

CD\ followed by directory name If directory does not exist, error message

– Invalid Directory– The system cannot find the path specified

Return to root directory by typing CD\

Page 17: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

17

Moving Between Directories

CD NOT used to move between drives Type drive letter followed by colon If drive does not exist:

– Invalid drive specification– The system cannot find the specified drive

Page 18: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

18

Making Directories

To make a directory To make a directory called QUAKE3 under

root directory: C:\>MD QUAKE3, press ENTER

If command is successfully executed, the command prompt will be displayed

Use DIR to verify that directory was created

Page 19: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

19

Removing Directories

Reverse of MD Go to directory that contains the

subdirectory you want to delete Execute RD command RD will not delete directory if it contains

subdirectories or files

Page 20: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

20

Running a Program

Change focus of prompt to the folder where program is located

Type name of program Press ENTER

Page 21: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

21

Working with Files

All files have 4 basic attributes:– Hidden– Read-only– System– Archive

Refer to photocopy for specific example of attribute command

Page 22: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

22

Renaming Files

REN or RENAME command (refer to photocopy for example)

Page 23: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

23

Delete Files

Use DEL command Careful! No recycle bin. Erased file can only be recovered using

Norton Unerase Can delete multiple files using wild cards

Page 24: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

24

Copying and Moving Files

Focus prompt on directory containing the file or folder to be copied

Type COPY or MOVE and a space Type name(s) of the file(s) to be

copied/moved and a space Type the path of new location for the files

(Refer to example on photocopy)

Page 25: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

25

The Software Core

Page 26: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

26

A Short History of MS-DOS

Page 27: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

27

Understanding DOS

All versions were built for a specific class of CPU.

MS-DOS never overcame critical limitations. All versions used a command-line interface. You must use the DOS prompt to set up a

new system or hard disk drive.

Page 28: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

28

DOS Boot Sequence and Files

Three core programs – IO.SYS– MSDOS.SYS– COMMAND.COM

Two optional startup files – CONFIG.SYS– AUTOEXEC.BAT

Page 29: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

29

Summary of Steps in Booting the System

1. The power-on self test (POST) runs and invokes the operating system (OS).

2. The read-only memory basic input/output system (ROM BIOS) looks for an OS and checks for IO.SYS and MSDOS.SYS.

3. The OS processes CONFIG.SYS, if present.4. COMMAND.COM is loaded.5. The OS processes AUTOEXEC.BAT, if present.6. COMMAND.COM presents the active-drive

prompt.

Page 30: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

30

The DOS File System

The file is the primary unit of data storage. Files are organized into directories. File and directory names can be up to eight

characters long, followed by a period and a three-character extension.

Some universal extensions are .exe, .com, .sys, .bat, .txt, .doc, and .drv.

File and directory names are not case-sensitive.

Page 31: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

31

The Evolution of Microsoft Windows

Early versions presented a graphical user interface (GUI) for MS-DOS.

Microsoft Windows 3.11 was the last 16-bit OS and the most well known version.

Microsoft Windows 95 was the first 32-bit version. All applications designed for Windows have

standard interfaces. Multitasking allows users to have more than one

application open.

Page 32: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

32

Operating Modes

Real mode could address only 1 MB of random access memory (RAM).

Standard mode allowed programs to run in protected mode.

In protected mode, programs could address up to 16 MB of RAM.

386 enhanced mode could address up to 4 GB of RAM.

Certain applications included a Windows runtime version.

Page 33: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

33

Windows Resource Management

Page 34: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

34

Memory Paging and Virtual Machines

Virtual memory is an area on the hard disk drive (called a swap file) that the system uses to store program code temporarily.

Virtual machines (VMs) allow multiple programs to operate.

DOS programs run individually in separate VMs.

Page 35: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

35

Windows Operating Systems

Microsoft Windows for Workgroups 3.11 is an upgrade to Microsoft Windows 3.1.

Windows 95, Microsoft Windows 98, and Microsoft Windows Me can be networked easily.

Microsoft Windows NT is designed for networking. Microsoft Windows 2000 replaces Windows NT. Upgrading to Windows NT or Windows 2000 could

present compatibility problems with some hardware and applications.

Page 36: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

36

The COMMAND Command

MS-DOS uses a text-based command-line user interface.

A text-based interface requires no drivers because display functions are built in.

COMMAND.COM provides the user interface.

Page 37: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

37

Working with the Prompt

Typing PROMPT /? or HELP PROMPT provides help information.

DOS HELP returns information on customizing the prompt and the information that appears.

Page 38: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

38

Internal and External Commands

External commands exist as separate files. Windows has its own set of system utilities. Internal commands are contained within

COMMAND.COM. Command mode requires typing a command

instead of clicking an icon.

Page 39: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

39

DOS Mode Navigation and File Management

The DOS file system uses a tree structure. A fully qualified path is the list of directories

from the root to the file. The DIR command displays the contents of

the current or a specified directory. DOS does not support Windows long

filenames. The MD command creates a new directory.

Page 40: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

40

The PATH Command

PATH allows you to display and change the search path.

%PATH% appends the old path to the new path.

Programs in path directories can be run from any location on the computer.

Page 41: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

41

Creating a Batch File

A batch file is an executable file that runs a series of existing commands or applications.

Commands listed in the file are executed in sequence.

Any executable that can be run from the prompt can be included in a batch file.

Page 42: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

42

Renaming a File

The RENAME or REN command allows you to rename a file.

The CD command allows you to change directories.

The CLS command clears the screen.

Page 43: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

43

Using Edit

Page 44: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

44

Summary of DOS Terminology

Page 45: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

45

CONFIG.SYS Commands

BUFFERS

COUNTRY

DEVICE

DEVICEHIGH

DOS

FCBS

FILES

INSTALL

LASTDRIVE

MOUSE.SYS

NUMLOCK

SHELL

SWITCHES

Page 46: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

46

AUTOEXEC.BAT Commands

DOSKEY

ECHO

KEYB

MOUSE.EXE

PATH

PAUSE

PROMPT

SET

SHARE

SMARTDRV

Page 47: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

47

File System Basics

The file system organizes data on the storage medium.

Different media require different file systems. File systems define naming conventions, file

size, and media capacity. Magnetic media employ several different file

systems, depending on the OS.

Page 48: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

48

Key File System Terms

Block Boot disk Boot sector Cluster Dual boot Encryption

End-of-file (EOF) marker

File File

allocation table (FAT)

File format File handle File locking

Filename Folder Format Low-level

format Master

boot record

Partition table

Primary partition

Sector Track Volume

Page 49: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

49

Comparing and Choosing File Systems

Decision factors: – Dual boot requirement– Number and size of hard disk drives– Size of partitions– Need to support legacy applications– Need for advanced features such as security

Page 50: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

50

FAT-Based File Systems

All modern PCs can use FAT. FAT organizes files by listing them in a table. Two copies of the table are maintained on

the media. FAT was developed for and is still used by

floppy disk drives. There are three versions: FAT12, FAT16,

and FAT32.

Page 51: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

51

FAT16 and FAT32 Compared and Contrasted

High compatibility Use of MS-DOS bootable floppy

disk Performance advantage on

small volumes Manual intervention to use FAT

copy No backup of boot sector 2-GB volume limit Better performance when

operating in real mode or safe mode

Dual boot with Windows NT and Windows 98

8.3 filenaming limit

Limited compatibility No use of MS-DOS bootable

floppy disk More efficient allocation of disk

space Automatic use of FAT copy if

needed Automatic backup of boot sector Support of 32-GB volumes Faster load times for

applications and large data files No dual boot with Windows NT

and Windows 98 Support of filenames up to 255

characters

FAT16 FAT32

Page 52: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

52

The NT File System (NTFS)

Was introduced with Windows NT Supports long filenames and is optimized for

multiuser environments Provides file and folder level security Is more reliable than previous file systems Is not completely supported under Windows

NT

Page 53: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

53

Advantages and Disadvantages of NTFS

Advantages Disadvantages Supports volumes up to 2 terabytes (TB)

Maintains a recovery log Has no limit on number of

entries at root Allows faster file access Supports disk quotas

(Windows 2000) Supports file and folder

compression Supports file and folder

security

Does not allow accessing NTFS volumes under MS-DOS, Windows 95, or Windows 98

Does not allow using NTFS volumes as a primary partition for dual booting MS-DOS, Windows 95, or Windows 98

Could decrease performance on volumes smaller than 400 MB

Page 54: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

54

File System Size Limitations

Different OSs handle cluster size differently. Under FAT volumes, drives smaller than

16 MB are formatted as FAT12. MS-DOS, Windows 95, and Windows 98

cannot access FAT16 volumes larger than 2 GB.

Page 55: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

55

File System Security

FAT attributes on FAT file systems

– FAT has attributes that can protect files from being overwritten or viewed.

– Attributes can be set by using the ATTRIB DOS-mode command, or by right-clicking a file in Windows and selecting the Properties option.

NTFS file and folder security

– NTFS uses permissions to determine who can access the file or folder.

– Permissions are set by using the Security tab for the file or folder.

Page 56: 1 Command Line Interface. 2 Lecture Objectives Explain the operation of the command line interface Execute fundamental commands from the command line.

56

Chapter Summary An OS is the interface between the hardware and the user. All OSs have a user interface, memory, and file

management. Technicians need to know how to perform command

prompt operations. Technicians who work with older OSs must understand

MS-DOS and DOS startup files. Internal and external commands can be used to configure

and troubleshoot. FAT32 has several enhancements over FAT16. NTFS supports file and folder security, compression, and

disk quotas.


Recommended