Social Icons

Pages

Wednesday, May 2, 2012

DISK OPERATING SYSTEM (DOS)

Internal commands:


1. cls (Clear the Screen)

Syntax:           cls
Example: C :\> cls

2. dir

The dir command typed by itself, displays the disk's volume label and serial number; one directory or filename per line, including the filename extension, the file size in bytes, and the date and time the file was last modified; and the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. The command is one of the few commands that exist from the first versions of DOS
Syntax: dir [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sort order]] [/S] [/B] [/L] [/V]
[drive:][path][filename]
Specifies drive, directory, and/or files to list. (Could be enhanced file specification or multiple file specs.)
/P
Pauses after each screen full of information.
/W
Uses wide list format.
/A
attributes:
D Directories
R Read-only files
H Hidden files
A Files ready for archiving
S System files
- Prefix meaning not
/O
List by files in sorted order, sort order:
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.


Syntax: dir [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sort order]] [/P] [/Q] [/S] [/T[[:]time field]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.
attributes
D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not
/B
Uses bare format (no heading information or summary).
/C
Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator.
/D
Same as wide but files are list sorted by column.
/L
Uses lowercase.
/N
New long list format where filenames are on the far right.
/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 (oldest first) G Group directories first - Prefix to reverse order
/P
Pauses after each screen full of information.
/Q
Display the owner of the file.
/S
Displays files in specified directory and all subdirectories.
/T
Controls which time field displayed or used for sorting
timefield
C Creation
A Last Access
W Last Written
/W
Uses wide list format.
/X
This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place.
/4
Displays four-digit years
Examples
dir
Lists all files and directories in the directory that you are currently in.
dir *.exe
The above command lists any executable file or any file that ends with .exe. See our wildcard definition for other wildcard (e.g. *) examples.
dir /ad
List only the directories in the current directory. If you need to move into one of the directories listed use the cd command.

dir /s
Lists the files in the directory that you are in and all sub directories after that directory, if you are at root "C:\>" and type this command this will list to you every file and directory on the C: drive of the computer.
dir /p
If the directory has a lot of files and you cannot read all the files as they scroll by, you can use this command and it will display all files one page at a time.
dir /w
If you don't need the info on the date / time and other information on the files, you can use this command to list just the files and directories going horizontally, taking as little as space needed.
dir /s /w /p
This would list all the files and directories in the current directory and the sub directories after that, in wide format and one page at a time.
dir /on
List the files in alphabetical order by the names of the files.
dir /o-n
List the files in reverse alphabetical order by the names of the files.

3. copy con

An internal command for creating a quick batch files in DOS or Windows. For example, to create the WRITE batch file, type:
Example: copy con write.bat
4. type

Syntax: type [drive:][path]<filename>Use: Display a file. The more command is frequently used in conjunction with this command.
Example: c :\> type muna.txt
Output:           This command displays the information contained in the filename muna.txt

5. attrib
Change or view the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory.
Syntax: attrib [+R|-R] [+A|-A] [+S|-S] [+H|-H][drive:][path][filename] [/S [/D]]

Options:
  • To add an attribute attach a '+' in front of it.
  • To remove an attribute attach a '-' in front of it
  • Attributes include
    • R - Read-only
    • A - Archive
    • S - System
    • H - Hidden
    • /D - Process folders as well.
    • /S - Process matching files in the current folder and all subfolders.

No comments:

Post a Comment