|| Tips Index || DOS : Navigation | Memory | Hard Disk
Configuration | Auto Execute | Batch | Misc

Navigation

(DOS - Disk Operating System)

  TIP: Tips and Tricks are highlighted in red throughout this page.

Drive to Drive

To move to another drive, simply type the drive letter followed by a colon and press enter; eg; A: [Enter] - to position yourself on the A: drive to look at the floppy drive contents.

Looking Around

With the use of just two commands, CD & DIR, you can move to any location on your drives, check the contents of a directory (folder) in a variety of ways, show hidden and system file or directories, or list your entire disk contents. These commands do not modify any information, they only show it to you.

TIP: If you want to know the options available for a command, followed it with /?
Help information, like the text, below will be displayed on the screen.

The commands are:

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 | 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.
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. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W.

Type DIR drive: to display the current directory in the specified drive without actually changing to the drive. And

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.
Type CD without parameters to display the current drive and directory.

Using The Commands

If you need a better explanation of what you are looking at, and how things are arranged, read the 'The Big Picure'.

The DOS help screen may look overwhelming, so let's look at the most common options used with these commands.

Typing these commands alone will show you every file and folder on your drive. But, by adding a few keystrokes, you can customize the information they give you!

DIR Tricks

Here are some tricks to help you list exactly what you want.
  • dir /a:h - lists all hidden files and folders
    (works with all attributes; r = read only / s = system / a = archived)
  • dir /o:e - lists file in order by their extension
  • dir a: - lists the a: drive from where ever you are
  • dir /windows - list windows files from where ever you are
  • dir /a:d or dir .? - lists only folders
  • dir.exe - list only files ending in .exe (works with any ending)
You can use the /w, /p, or /s options with any of the above commands to control the display.

TIP:You can force DOS to a default display style when you type dir by adding a line to your AUTOEXEC.BAT file. It's in the top folder of your C: drive.

Here's an example line:

SET DIRCMD=/W/O:N

This will set you default directory display to wide with the files in order by name. Check the options in the command information to select a display format.

 

CD Tricks

Here are some tips for moving around.

  • cd - shows the current folder name
  • cd\ - moves you to the top most level of folders
  • cd.. - moves you up 1 level of folders
  • cd\windows\system - moves you to the top level, then down through the windows folder, into the system sub-folder
Using these two commands, you can move back and forth between folders with ease and view any files you want.

 

1