You are viewing an obsolete version of the DU website which is no longer supported by the Administrators. Visit The New DU.
Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Reply #7: Full reference for dos DIR command [View All]

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » Topic Forums » Election Reform Donate to DU
FULL_METAL_HAT Donating Member (673 posts) Send PM | Profile | Ignore Thu Dec-23-04 03:50 PM
Response to Original message
7. Full reference for dos DIR command
http://www.computerhope.com/dirhlp.htm#03

DIR SYNTAX

Microsoft Windows 95, 98, and ME syntax

Displays a list of files and subdirectories in a directory.

DIR

attributes]] sortorder]]

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 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.

Microsoft Windows 2000 and Windows XP syntax

Displays a list of files and subdirectories in a directory.

DIR attributes]] sortorder]]

timefield]]

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 screenful 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 /ad = List only the directories in the current directory.
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 that is on the computer.
dir /p = If the directory has a lot of files and you cannot read all the files 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 horizontal 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 one page at a time.

ADDITIONAL INFORMATION

DIR \ /S |FIND "i" |MORE = A nice command to list all directories on the hard drive, one screen page at a time, and see the number of files in each directory and the amount of space each occupies, use this command:

DIR > myfile.txt - Takes the output of dir and re-routes it to the file myfile.txt instead of outputting it to the screen.


Printer Friendly | Permalink |  | Top
 

Home » Discuss » Topic Forums » Election Reform Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC