Beruflich Dokumente
Kultur Dokumente
File
A file is a collection of related information. Files can be of three types –
1# Text Files
Text files are data files that contain characters, numbers and symbols.
2# Command Files
A set of DOS commands put together to perform a specific task which can later be put
together in a text file are called Command Files.
3# Application Program Files
Any application program such as Word Processor is stored in a command file which
stores our work such as a document in data files.
File Name
A string of characters used to identify a document is termed as File Name. Assigning a name
to a file requires two things – File Name & Extension such as –
Report.doc Letter.txt Setup.exe
The extension part that is .doc, .txt, .exe gives information about the type of file. For instance
Report.doc is a document file with file named Report. Similarly Letter.txt is a text file with
file named Letter and Setup.exe is an application program file with file named Setup.
Directory
A directory is one where files can be kept. A directory keeps record about the files being kept
such as –
Date when file was created Time Size Type File/Directory
last modified Name
12/09/08 09:32 PM 8 Kb work1.txt
07/08/08 07:48 AM 1024 Kb <DIR> Box
Volume Label
Any diskette or fixed disk can be assigned a name or volume label to identify its contents.
An 11 Character name can be assigned at the time of formatting.
System Prompt
The first thing you’ll see when you open DOS is the system prompt. Something as follows
C :\> _ or D :\> _ C, D, E, F etc shows the default disk drive where
DOS has been installed.
It also shows the current determined location such as –
D:\Rahul\Various>_
It shows that your current location or you are in a subdirectory named ‘Various’ that is inside
a directory named ‘Rahul’ of ‘D’ drive.
Time Command
This command is used to see or to modify the system’s time. The command line will be
C:\>time after pressing the enter key will output –
The current time is: 15:10:44.09
Enter the new time: _
In the above second line leave blank and press enter key to keep
the current time or type the new time in the following format hh:min:sec to change your
system’s time.
Dir Command
This command is use to see the directories or files of any drive or location. Command line -
C:\>dir Shows the directories in ‘C’ drive.
C:\>dir D:\
D:\>dir Shows the directories in ‘D’ drive.
C:\>dir D:\Rahul\
D:\Rahul>dir Shows directories of Rahul directory of ‘D’ drive.
C:/>dir D:\*.txt shows all the files with the extension .txt of
‘D’ drive.
Chdir or CD Command
This command is used to logon or access a directory. Full name of CD is Change Directory.
CD command can be used as follows –
C:\>CD Rahul will output as follows –
C:\Rahul>_ which shows that you have accessed to directory
named Rahul of ‘C’ drive.
Logging On to a Drive
Logging On to a drive means to change the drives so as to access its contents or to do some
particular function. You have to type the drive letter followed by a colon and after pressing
Enter key you are on the drive. The following illustration explains this –
If you are in system prompt i.e. C:\>_ then typing drive letter ‘D’ which refers to ‘D’
drive followed by a colon will output D:\>_ which means you have now access to ‘D’ drive.
Ex. C:/>D: <┘ will show D:\>_ D:\>E: <┘ will show E:\>_
E:\>F: <┘ will show F:\>_ F:\>C: <┘ will show C:\>_
C:\>Copy con E:\Rahul.txt after pressing the enter key you will see a
cursor blinking to the next line. This means that you can now write data in your file and
when u have finished writing press Control Key and Z together to save the contents after that
you have been output a message 1 file copied followed by the system prompt in the next line.
This will make you a file named Rahul.txt in ‘E’ drive.
Del Command
This command is used to delete a file. Command syntax is as follows –
C:\>Command Location FileName.Ext
C:\>Del E:\Rahul.txt will delete the file named Rahul.txt from ‘E’
or E:\>Del Rahul.txt drive.
Tree Command
This command shows the directory structure like the branches of a tree.
C:\>Tree <┘ will show the directory tree of ‘C’ drive.
C:\>Tree D: <┘
Or D:\>Tree <┘ will show the directory tree of ‘D’ drive.
C:\>Type E:\Rahul.txt this shows the contents of the file named Rahul.txt
Or E:\>Type Rahul.txt of ‘E’ drive.
Copy Command
The command is used to copy or make duplication of files. Command syntax is –
C:\>Copy E:\Rahul.txt D:\ will copy a file named Rahul.txt of ‘E’ drive
Or E:\Copy Rahul.txt D:\ to ‘D’ drive.
Copying all files with same extension from one drive to another.
C:\>Copy E:\*.txt D:\ copies all files having extension .txt of ‘E’ drive to
Or E:\>Copy *.txt D:\ ‘D’ drive.
Copying all files with same extension from one location to another.
C:\>Copy E:\Bag\*.txt D:\Box\ copies all files having extension .txt from a
Or E:\Bag>Copy *.txt D:\Box\ a directory named Bag of ‘E’ drive to a
directory named Box of ‘D’ drive.
Copying a file having some filename from a location to another location with some
other file name.
C:\>Copy E:\Bag\Old.txt D:\Box\New.txt
Or E:\Bag>Copy Old.txt D:\Box\New.txt
Copies a file named Old.txt which is inside a directory named Bag of ‘E’ drive to a
Directory named Box of ‘D’ drive with file named New.txt
Copying the contents of two files with same extension from a location in one file with some
other filename to another location.
If R1.txt & R2.txt are two files located inside a directory named Rahul of ‘E’
drive, whose contents should be combined into a new file named Combined.txt in ‘D’ drive
then the command used should be –
E:\Rahul>copy R1.txt+R2.txt D:\Combined.txt
Note: - To use the command correctly you must log on up to the location or position of the
files whose contents are to be combined. Have a look – if you just typed the location of the
files from the root for SOURCE files then it shows an invalid message. The following
command line will make it more clear to you.
Ren Command
This command is use to Rename a file. Command syntax will be –
C:\>Command <Location><Old filename.ext> <New filename.ext>
C:\>Ren E:\Bag\Old.txt Bigbang.txt will rename the file named Old.txt which is
Or E:\Bag>Ren Old.txt Bigbang.txt inside a directory named Bag of ‘E’ drive to
A new filename named Bigbang.txt
Move Command
This command is use to move files from one location to another location. Command syntax
will be –
C:\>Command <Source Location> <Target Location>