the command line interface. the os files io.sys msdos.sys command.com io and msdos are hidden files,...

29
The Command Line Interface

Upload: donna-casey

Post on 27-Dec-2015

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

The Command Line Interface

Page 2: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

The OS files

• IO.sys

• MSDOS.sys

• Command.com

• IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Page 3: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

The Prompt

• This can be (re)set using the PROMPT command

• Displays the current drive and current directory

• A:\>

• This means the computer is waiting for you to type some command and is “looking” at the A: drive, root directory

Page 4: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Where is the Command Line?

• In Windows 9x, click Start | Run and type COMMAND

• In Windows 2000, XP, click Start | Run and type CMD

• In Vista and 7, click Start and type CMD in the Search Box

• Either way, you get to a black screen with white lettering

Page 5: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings
Page 6: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

And to get out of it

• Type EXIT at the prompt – or -

• Click on the close box (upper right corner)

Page 7: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

File Names

• Classic is 8.3; Windows still creates them• FileNa~1 for File Named Joe• 2K and XP will do this five times, then switch to

different method• File extensions link file to creating

program .DOC for Word documents, .XLS for Excel spreadsheets and now .DOCX and .XLSX

• Program files are .EXE or .COM• Windows file names can be 255 characters

Page 8: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

File Format

• Each (version of a) program stores its file(s) in a specific format

• Some programs can “read” other file formats, some won’t

• Simply changing the file extension DOES NOT change the file format

• You need to watch this when sending files to other people: they need the application you used, or one that can read that format

Page 9: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

File Header

File Data (in some form)

File FooterASCII file in contrast

Clear Text

Page 10: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

ASCII

• American Standard Code for Information Interchange

• 256 characters (8-bits)

• Alphabets are in lower 128 codes

• ASCII files (.txt) often contain “tuning” information for applications

• Use NotePad to create or edit

Page 11: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Unicode

• 16-bit version of 8-bit ASCII

• Lower 256 codes of Unicode line up with ASCII

• Allows special characters and languages to be used with Windows

Page 12: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

File Organization

• We start at the “root” of a drive

• We add “folders” (or directories) at the root level

• We can then add files, or more folders, under those folders

Page 13: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Income Data Expenses Games

FebJanJan Feb Mar

C:\Can contain files or

directories

C:\Income\Jan\Inc.txt

Inc.txt

Page 14: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

DIR• Gives you a directory listing of the current

directory (without any additional info)

Page 15: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

CD

• Change Directory

• CD <name> to go down one level

• CD .. To go up one level

Page 16: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Change Drive

• Type drive letter and colon, press <Enter>

• A:\>C: takes you from A: to C: drive

• C:\>A: takes you back to A:

• Can be combined with most commands

• DIR A:\ will give you the directory of A:\ (root) directory from any location on any other drive

Page 17: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

MD

• Make directory immediately below current directory

RD [/s]

• Removes directory immediately below current directory – must be empty, unless you use the /S option

• There is NO recycle bin at the command prompt

Page 18: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Running a Program

• Type the name of the program, any switches and press <Enter>

• We will do this with FDISK and FORMAT

• Programs have .COM or .EXE extensions

Page 19: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Create a File

• For our work at the Command Prompt, use Notepad to create .TXT file(s) with just some text in them

• Any command prompt, then type notepad at that prompt to open NotePad

Page 20: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Copy

• Copy <what> <where>

• Copy c:\test\file1.txt c:\real\file1.txt

• C:\real>copy c:\test\file1.txt

Page 21: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Rename a file

• REN <what> <new name>

• REN rico.txt arturo.txt

• Obviously, rico.txt has to exist and arturo.txt does not exist

Page 22: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

File Attributes

• Four basic attributes: Hidden, System, Read Only and Archive

• Turn on attribute with: ATTRIB + (h,s,r,a)

• Turn off an attribute with: ATTRIB – (h,s,r,a)

Page 23: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Wildcards• The asterisk (*) will replace (up to) eight

characters (or more, for long file names)

• The question mark (?) will replace ONE character

• *.DOC = all files that have .DOC extension

• File0? = file01, file02, file03 to file09

• Jan* = all files that start with Jan

• Can be used with almost all commands that take a file name

Page 24: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Delete a File

• DEL or ERASE command

• There is no UNDO command; it is gone forever

• Be very careful with this command

Page 25: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Batch Files

• ASCII text files (use NotePad or Edit) with .BAT extension

• Can include all the commands we have looked at, plus lots more

• Can save a lot of typing if you want to do the same thing over and over

Page 26: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

CHKDSK

• Check Disk command.

• It needs total access to hard disk drive

• Will lurk in background until you restart the system; then it will run after POST and before Windows loads.

Page 27: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

SFC

• System File Checker

• Sfc /scannow

• Tends to undo a Service Pack upgrade

• Wants the Windows installation media

Page 28: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

Shutdown

• That’s what it does

• Can shut down a remote system

Page 29: The Command Line Interface. The OS files IO.sys MSDOS.sys Command.com IO and MSDOS are hidden files, COMMAND.COM shows in directory listings

break buffers call cd

chcp chdir choice cls

copy country ctty date

del device devicehigh dir

dos drivparm echo erase

errorlevel exist exit fcbs

files for goto if

include install lastdrive lh

loadfix loadhigh md menucolor

menudefault menuitem mkdir move

not numlock path pause

prompt rd rem ren

rename rmdir set shell

shift stacks submenu switches

time truename type ver

verify vol