Introduction
A) Directory Operations
01. dir
02. cd
03. md
04. rd
B) Disk Drives
a> format
b> label
C) File Operations
05. del
06. copy
07. type/more
08. copy con
09. ren
D) DOS in Windows
10. start
11. netatat
E) Miscellaneous Commands
12. date
13. time
14. echo
Disclaimer
INTRODUCTION
This text tells you all about MS DOS and it's commands and their
usage.... Read on.. :)
Read the Disclaimer at the end of the text..
Please feel free to e-mail me at klemd@infoprince.net for any help
or tips or suggestions or corrections.
A) Directory Operations
--------------------
This part has been written assuming that you know about Directories.
i.e. The Windows Folders.
01. dir
The dir command prints the contents of a directory on the screen.
syntax: dir
ex:
C:\ss>dir
Volume in drive C is SRISHNET
Volume Serial Number is 1A64-13D6
Directory of C:\ss
SETUP EXE 140,800 06-18-98 12:00a setup.exe
SETUP LST 4,225 01-03-99 2:54p SETUP.LST
SRISHSEE CAB 2,034,988 01-03-99 2:55p SrishSee.CAB
3 file(s) 2,180,013 bytes
2 dir(s) 1,556.21 MB free
Switch Operators:
/p: The /p switch is used where the contents of a directory are
too big to be printed on the screen. It pauses after the
screen is full and waits for you to hit a key. ex: dir /p
/w: The /w switch is used to print the contents of a directory in
wide format. i.e. print maximum amount of file on the screen.
ex: dir /w
/a: The /a switch prints all the files in a directory. i.e. it
displays even the hidden files. ex: dir /a
USING THE DIR COMMAND:
WILD CARDS:
The '*' Wild Card
To display files with some extension, use dir *.
ex: dir *.txt
To display files with some filename prefix and different
extension, use dir .*
ex: dir abc.*
As you would've guessed by now, * denotes all the characters in
a place (filename/extension).
The '?' Wild Card
To display files having some characters common in definite
places, we use the ? operator.
ex: dir ??b.??t
This displays all the files in the directory of size 3
characters, with the third character as b and in the
extension, the last character as t.
Say you have the foll. files in you directory:
123.txt sjcs.had make.bmp bob.txt hello.htm job.dat
The files displayed would be bob.txt, job.dat.
ex: dir m?ss.*
This displays all the files in the directory of size 4
characters, with the second character anything and the
1st, 3rd and 4th characters are specified(m,s,s) and
any extension.
Say you have the foll. files in you directory:
mess.txt sjcs.had mass.bmp bob.txt hello.htm job.dat
The files displayed would be mess.txt, mass.bmp.
02. cd / chdir
The cd command changes the current working directory.
cd\ takes you to the root directory. i.e. to c:\ if working in c:
cd.. goes one directory back. cd... goes 2 directories back...
syntax: cd
ex:
C:\>cd ss
C:\ss>cd..
C:\>
03. md / mkdir
The md command creates a directory of a required name.
syntax: md
ex: C:\>md abc
04. rd / rmdir
The rd command deletes a directory if it is empty.
syntax: rd
ex: C:\>rd abc
B) Disk Drives
-----------
There are different kinds of disk drives:
Hard Disk, Floppy Disk Drive, CD Drive, etc..
The Drives for the Floppies are A: and B:
The Drives for the hard disk is C:, D:, etc..
The usually CD Drive has the Drive Letter after the last of the Hard
Disks/Hard Disk Partitions. ex: E: if the last HD partition is D:
To access a particular drive, just type the :
ex: D:\>c:
C:\>
a. format
------
Formatting a disk drive means to make the drive readable by the
operating system. Different OS's have different file systems and
so, to make a drive readable to that particular OS, it should be of
that OS format.
During a format, all the data on the disk is erased.
To format a particular drive, you type format :
ex: format a:
b. label
-----
To label a disk, or to view the current label or to delete the
current label, you use the command label :
ex: label a:
C) File Operations
---------------
A DOS File-name has three parts: a prefix, a dot and an extension.
The Prefix is of 8 characters or less. Special characters except
~, - and _ cannot be a part of the prefix. This part contains the
actual name of the file.
The dot seperates the prefix and suffix.
The extension is of 3 characters or less, again cannot have special
characters other than ~, - and _. This denotes the kind of file.
i.e. .com/.exe - executable
.bat - batch file (with some pre-written DOS commands)
.dat - data file
other extensions....
The .com,.exe and .bat files can be executed by just typing the
file prefix or the full name at the prompt.
ex: C:\>ancs
C:\>ancs.exe - both do the same.
05. del
The del command deletes a file.
Wild cards can be used with this command.
To delete all the files in a directory, del *.* can be used.
syntax: del
ex: C:\>del abc.txt
06. copy
The copy command is used to copy files from one location to
another.
Wild cards can be used with this command.
syntax: copy
ex: C:\>copy abc.txt A:\abc.txt
07. type/more
The type/more command displays the contents of a file.
syntax: type
more
ex: C:\>type abc.txt
C:\>more abc.txt
08. copy con
The copy con command creates a new file, and let's you enter the
contents of the file.
To save the file that you have just written the contents of,
after the end press [Ctrl] + Z.
To abort the action, i.e. not to save the file use [Ctrl] + C.
syntax: copy con
ex:
C:\>copy con abc.txt
hello... testing...
^Z
1 file(s) copied
C:\>
09. ren
The ren command lets you rename an existing file.
Wild cards can be used with this command.
syntax: ren
ren
ex: C:\>ren abc.txt xyz.dat
C:\>ren abc xyz
D) DOS In Windows
--------------
MS Windows 9x and 2000 use DOS as their backbone.
Winsows XP has left out DOS and is independent.
Therefore, while running Windows, DOS has some added functionality.
There are some extra commands.
10. start
-----
To start a Windows program from DOS while running Windows.
i.e. to open/execute a file using Windows.
syntax: start
ex: C:\>start abc.txt
11. netstat
-------
To display the network connections to your computer.
syntax: netstat
Use netstat -a to just display the active connections.
Use netstat -an to display the active connections with IP's.
E) Miscellaneous Commands
----------------------
12. date
----
To display the current computer date, use the date command.
It also allows you to change your computer date.
To let it the way it is, just hit .
syntax: date
ex: C:\>date
Current date is Mon 10-15-2001
Enter new date (mm-dd-yy):
13. time
To display the current computer time, use the time command.
It also allows you to change your computer time.
To let it the way it is, just hit .
syntax: time
ex: C:\>time
Current time is 3:42:41.44p
Enter new time:
14. echo
To print a particular message on the screen, you use echo.
This command is used in batch (*.bat) files.
syntax: echo
ex: C:\echo Hello World
Hello World
Even the C:\> prompt is an echo. To remove it, you use "echo off".
In batch files, if you don't want the user to see the commands
that you have prewritten, you can use this.
To enable it again, you use "echo on".
DISCLAIMER
There is no garuntee on the accurateness of this article and
this is subject to change anytime. This text is meant only for
educational purposes, not anything else. Following or reading this
article is entirely the user's choice and at the user's risk. I will
not be responsible for any damages caused directly or indirectly to
anyone or anything.
News :
Nama anda dan nama orang yang anda sayangi bisa berada di Mars.Mau tahu caranya klik saja di sini
Tanpa harus menuju ke situs yang melayani pengiriman SMS gratis dari internet, anda bisa mengirim SMS dari komputer anda.Anda bisa sekaligus mengirim ke banyak teman dengan pesan yang sama hanya dengan satu klik.Gunakan saja software keren ini.
Sering download file gede yang tak tertampung disket 3 1/2 floopy di warnet? Gunakan software ini untuk memecahnya sehingga tertampung ke disket, kemudian menggabungkan kembali file-file pecahan tersebut ke ukuran asalnya.