dos and the command line cs 21a: introduction to computing i department of information systems and...

7
DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Upload: cornelia-mclaughlin

Post on 05-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

DOS and the Command Line

CS 21a: Introduction to Computing I

Department of Information Systems

and Computer ScienceAteneo de Manila University

Page 2: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 2

What is DOS?

Disk Operating System Enables the user to organise data

files, load and execute (run) program files

Entirely text-based, command-line system where the user can type in commands from the keyboard

Page 3: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 3

Launching the command line

From the Start menu, choose Run Type command or cmd and click OK

Or: download cmdhere.bat from the course website, place in a folder, and then double-click

To close the command line, type exit and press <enter>

Page 4: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 4

A word of warning

With DOS comes power; you can very easily mess up your system if you use powerful commands in the wrong way

Be EXTREMELY careful when using these commands: format fdisk del / deltree

Page 5: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 5

Useful DOS commands dir – display current directory

use /w or /p if directory has a lot of files ? stands for a single digit or letter * stands for a combination of digits and/or letters

cd <folder-name> – change current directory . – current directory .. – parent directory

md <folder-name> - make new folder copy <source-file> <dest-file> - copies the

<source file> to a file called <dest-file> del <file> - deletes a file

Page 6: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 6

Java commands javac <java-source-file> - compile a java

program java <java-class-name> - execute a java

program javadoc < java-source-file > - generate java

documentation javap <java-class-name> - print information

about the java class (Note: PATH should include location of the java

executables; automatically set by cmdhere.bat)

Page 7: DOS and the Command Line CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University

Copyright 2008, by the authors of these slides, and Ateneo de Manila University. All rights reserved.

L2: DOSSlide 7

DOS exercise Open a command line terminal Create and compile the Hello.java program

on your desktop Create a “cs21a” subdirectory under c:\

Documents and Settings\Guest\Desktop Copy Hello.java and Hello.class to the

“cs21a” directory by using JUST 1 copy command

Delete the Hello.java and Hello.class files on your desktop