Friday, October 5, 2007

DOS





DOS (from Disk Operating System) commonly refers to the family of closely related operating systems which dominated the IBM PC compatible market between 1981 and 1995 (or until about 2000, if Windows 9x systems are included): DR-DOS, FreeDOS, MS-DOS, Novell-DOS, OpenDOS, PC-DOS, PTS-DOS, ROM-DOS and several others. They are single user, single task systems. MS-DOS from Microsoft was the most widely used. These operating systems ran on IBM PC type hardware using the Intel x86 CPUs or their compatible cousins from other makers. MS-DOS is still common today and was the foundation for many of Microsoft's operating systems (from Windows 1.0 through Windows Me). MS-DOS was later abandoned as the foundation for their operating systems.

History
MS-DOS
(and the IBM PC-DOS which was licensed therefrom), and its predecessor, QDOS, was an imitation of CP/M (Control Program / (for) Microcomputers) — which was the dominant disk operating system for 8-bit Intel 8080 and Zilog Z80 based microcomputers. It was first developed at Seattle Computer Products by Tim Paterson as a variant of CP/M-80 from Digital Research, but intended as an internal product for testing SCP's new 8086 CPU card for the S-100 bus. It did not run on the 8080 (or compatible) CPU needed for CP/M-80. It was called QDOS, among several other names. Microsoft licensed it from SCP, made changes and licensed the result to IBM (sold as PC-DOS) for its new 'PC' using the 8088 CPU (internally the same as the 8086), and to many other hardware manufacturers. In the later case it was sold as MS-DOS.
Digital Research produced a compatible product known as "DR-DOS", which was eventually taken over (after a buyout of Digital Research) by Novell. This became "OpenDOS" for a while after the relevant division of Novell was sold to Caldera International, now called SCO. Later, the embedded division of Caldera was "spun off" as Lineo (later renamed Embedix), which in turn sold DR-DOS to a start-up called Device Logics, who now seem to call themselves DRDOS, Inc.
DOS was one of the first operating systems for the PC compatible platform, and the first on that platform to gain widespread use (it was still widespread more than 10 years later). This was a quick and messy affair (the variant MS-DOS, sometimes colloquially referred to as Messy DOS, was developed from QDOS, which literally meant "Quick and Dirty Operating System").
IBM-PCs were only distributed with PC-DOS, whereas PC compatible computers from nearly all other manufacturers were distributed with MS-DOS. For the early years of this operating system family, PC-DOS was almost identical to MS-DOS.
Early versions of Microsoft Windows were little more than a graphical shell for DOS, and later versions of Windows were tightly integrated with MS-DOS. It is also possible to run DOS programs under OS/2 and Linux using virtual-machine emulators. Because of the long existence and ubiquity of DOS in the world of the PC-compatible platform (DOS compatible programs were made well into the '90s), DOS was often considered to be the native operating system of the PC compatible platform.
There are alternative versions of DOS, such as FreeDOS and OpenDOS. FreeDOS appeared in 1994 due to Microsoft Windows 95, which differed from Windows 3.11 by being not a shell and dispensing with MS-DOS.[1]

Essential Commands

dir: Lists names of files in current directory (folder)
dir Hello.* Lists all files whose names start with Hello.
cd C:\files: Changes directory to C:\files ("absolute" pathname)
cd myfiles: Changes directory to myfiles subdirectory of current directory ("relative" pathname)
cd ..Changes directory to "parent" of current directory
notepad Hello.java: MS-DOS text editor, used to create and edit ASCII textfiles
type Hello.java: Displays contents of ASCII textfile on screen
exit: Ends command interpreter, makes console window go away...



command COMMAND.COM

Starts a new copy of the Windows Command Interpreter.

COMMAND [[drive:]path] [device] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]

[/LOW] [/Y [/[CK] command]]

[drive:] path Specifies the directory containing COMMAND.COM.
device Specifies the device to use for command input and output.
/E:nnnnn Sets the initial environment size to nnnnn bytes.
(nnnnn should be between 256 and 32,768).
/L:nnnn Specifies internal buffers length (requires /P as well).
(nnnn should be between 128 and 1,024).
/U:nnn Specifies the input buffer length (requires /P as well).
(nnn should be between 128 and 255).
/P Makes the new Command Interpreter permanent (can't exit).
/MSG Stores all error messages in memory (requires /P as well).
/LOW Forces COMMAND to keep its resident data in low memory.
/Y Steps through the batch program specified by /C or /K.
/C command Executes the specified command and returns.
/K command Executes the specified command and continues running.

CD Change Directory-------
Displays the name of or changes the current directory.

CHDIR [drive:][path]

CHDIR[..]

CD [drive:][path]

CD[..]
.. Specifies that you want to change to the parent directory (in other words: Move up one folder in the directory tree). DOS 7, WHEN using a DOS-window, allows you to use extra dots here! If you were in C:\WINDOWS\SYSTEM\shellext, you could enter cd... to go up to C:\WINDOWS or even cd.... to get to the root.

Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.

chcp Change Code Page-------
Displays or sets the active code page number.

CHCP [nnn]
nnn Specifies a code page number.

Type CHCP without a parameter to display the active code page number.

cls Clear Screen-------
Clears the screen.
CLS

copy Copy or Concatenate Files-------
copies one or more files to another location.

COPY [/A /B] source [/A /B] [+ source [/A /B] [+ ...]] [destinati [/A /B]] [/V] [/Y /-Y]

source Specifies the file or files to be copied.

/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line

To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).

Note this special case of the COPY command:
copy con output.txt Copy from Console to ...

After you type this command and press ENTER, MS-DOS copies everything you type to the file OUTPUT.TXT. When you are finished typing, press CTRL+Z to indicate that you want to end the file. The Control-Z character will appear on the screen as " ^Z ". You can also end a COPY CON command by pressing the F6 key. Pressing F6 also generates the Control-Z character; a " ^Z " still appears on the screen.

The following example copies information from the keyboard to a printerconnected to LPT1: copy con lpt1

ctty Change Termial Type-------
Changes the terminal device used to control your system.

CTTY device
device The terminal device you want to use, such as COM1.

date-------
Displays or sets the date.
DATE [date]

Type DATE without parameters to display the current date setting anda prompt for a new one. Press ENTER to keep the same date.

del Delete (Erase) Files
Deletes one or more files.
DEL [drive:][path]filename [/P]
ERASE [drive:][path]filename [/P]
[drive:][path]filename Specifies the file(s) to delete. Specify multiple files by using wildcards.
/P Prompts for confirmation before deleting each file.

Note: In most cases the file is NOT actually "erased"; the space it usedis simply noted as being available for new files to write over it. If youreally want to erase every word of a sensitive file, you should get a'security program' designed to overwrite all erased files!

dir Directory Listing-------
Displays a list of files and subdirectories in a directory.

DIR [drive:] [path][filename] [/P] [/W] [/A[[:]attributes]]
[/O[[:]sortorder]] [/S] [/B] [/L] [/V]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

(Could be enhanced file specification or multiple filespecs.)

/P Pauses after each screenful of information.
/W Uses wide list format.
/A Displays files with specified attributes.

attributes
D Directories
H Hidden files
A Files ready for archiving
R Read-only files
S System files - Prefix meaning not

/O List by files in sorted order.

sortorder
N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
- Prefix to reverse order
A By Last Access Date (earliest first)

/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.

Switches may be preset in the DIRCMD environment variable. Overridepreset switches by prefixing any switch with - (hyphen)--for example, /-W.

exit-------
Quits the COMMAND.COM program (command interpreter).
EXIT
If you're in a DOS-Window in Windows, this will close the window!

lock-------
Locks a drive, enabling direct disk access for an application.
LOCK [drive:]

Note: If you use this command in a DOS-Window, it will only affect the floppy disk drives; Windows™ 95/98 does not allow you to lock a drive directly while it is operating. If you try lock C: , you'll get the errormessage: " Locking operation failed."

md Make Directory-------
-------Creates a directory.
MKDIR [drive:]path
MD [drive:]path

path -------
Displays or sets a search path for executable files.
PATH [[drive:]path[;...]]
PATH ;

Type PATH (without any parameters) to display the current path.
Type PATH ; (PATH space semi-colon) to CLEAR all search-path settings;

this means that DOS will only be able search the current directory.

NOTE: When used in a DOS-Window, these commands ONLY apply tothat particular DOS-Window! (The PATH will not be changed globally.)See the SET command for a similar effect in DOS-Windows, and alsofor a utility (W95envar.zip) that will make global changes!

prompt-------
Changes the Windows command prompt.PROMPT [text] text Specifies a new command prompt.Prompt can be made up of normal characters and the following special codes:

PROMPT [text]

text Specifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:

$Q = (equal sign)
$$ $ (dollar sign)
$T Current time
$D Current date
$P Current drive and path
$V Windows version number
$N Current drive
$G > (greater-than sign)
$L < (less-than sign) $B (pipe) $H Backspace (erases previous character) $E Escape code (ASCII code 27) $_ Carriage return and linefeed Type PROMPT without parameters to reset the prompt to the default setting. rd Remove (Delete) Directory-------

Removes (deletes) a directory.
RMDIR [drive:]path
RD [drive:]path

ren Rename File or Directory-------
Renames a file/directory or files/directories.
RENAME [drive:][path][directoryname1 filename1] [dirname2 filename2]
REN [drive:][path][directoryname1 filename1] [dirname2 filename2]

Note that you cannot specify a new drive or path for your destination.

set -------Displays, sets, or removes Windows environment variables.
SET [variable=[string]]
variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the variable.
Type SET without parameters to display the current environment variables.

Note: If you use SET in a DOS-Window to add a variable and string, itwill only affect commands run in that particular window! Unlinke Win NT(which has a DOS 'Environment' Tab), Windows™ 95/98 normally willnot allow you to set global Environment strings while the OS is running:You have to set them in AUTOEXEC.BAT and reboot the system!

time -------Displays or sets the system time.
TIME [time]

Type TIME with no parameters to display the current time setting and a prompt for a new one. Press ENTER to keep the same time.

type -------Displays the contents of text files.
TYPE [drive:][path]filename

NOTE: If there are more than 25 lines in the file, you'll need to pipethe screen output through the DOS External Command MORE in orderto keep all but the last screen from flashing past you!

EXAMPLE: C:\>type tips.txt more

unlock-------Unlocks a drive, disabling direct disk access for an application.

UNLOCK [drive:]

ver Version-------Displays the Windows version.
VER

vol Volume Label/SN-------Displays the disk volume label and serial number, if they exist.

VOL [drive:]

Note: The DOS command to change a Volume Label is an "External Command"(the program is: LABEL.EXE).

Useful FTP Commands

ftp ftp.cs.unca.edu
Attempts to start anonymous FTP session on remote Computer Science server. Enter ftp for userid and your bulldog email address for password. Note: Before attempting to upload files, remember to cd to appropriate dropoff directory as shown below.

ftp candler.cs.unca.edu
Attempts to start FTP session on remote Computer Science server candler.cs.unca.edu. You will need to provide your CSCI userid and password for this host. Note: This command connects you to your own home directory, not the site used for making dropoffs.

ftp> ascii
FTP command to set data transfer mode to ASCII (default, suitable for .java source files and other textfiles)

ftp> binary

FTP command to set data transfer mode to binary (suitable for .class files and other binary files)

ftp> status

FTP command to display status, including current data transfer mode (ASCII or binary)

ftp> cd pub/202/fred1234

FTP command to change current directory on remote host

ftp> lcd examples

FTP command to change current directory on local system

ftp> put Hello.java

FTP command to copy file Hello.java from current directory on local system to current directory on remote host

ftp> mput *.java

FTP command to copy all files ending with .java from current directory on local system to current directory on remote host

ftp> quit

FTP command to end session, breaks contact with remote host

MS-DOS Commands for Manipulating Environment Variables

path

Displays current value of PATH environment variable (list of directories containing DOS command programs)

set path=C:\jdk1.3.1\bin;%PATH%

Adds Java SDK system directory C:\jdk1.3.1\bin to current PATH environment variable (applies only to current session).

No comments: