Microsoft KB Archive/66254

Displaying a Directory in Sorted Order PSS ID Number: Q66254 Article last modified on 10-30-1990 PSS database name: PSS

Summary:

A sorted directory listing can be displayed from DOS. DOS version 2.0 or later is required to use the following sequence of commands. Since “sort” and “more” are transient DOS commands, the DOS directory must appear in the path statement.

To obtain a directory sorted by the first letter of the filenames, execute the following command on Drive C:

dir | sort | more

To obtain a directory sorted by the size of the filenames, execute the following command on Drive C:

dir | sort /+14 | more

Consult a DOS manual for further information on using the sort command.

Copyright Microsoft Corporation 1990.