How to search inside directories in DOS or DIR Command

Home Forums DOS How to search inside directories in DOS or DIR Command

This topic contains 0 replies, has 1 voice, and was last updated by  Admin 4 months, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #107

    Admin
    Keymaster

    DIR Commands

    Two little characters, ‘*’ and ‘?’, will make your life with computers much easier. Their use is illustrated below.
    Example:

    C> dir c:*.exe
    Lists all files on the C drive with an extension of ‘EXE’.
    C> dir c:Apple.*
    Lists all files on the C drive with a filename of ‘Apple’.
    The asterisk is a wild-card character which allows the user to enter only a limited part of a file specification to find a file. It is useful when you wish to locate a group of files with the same filename or the same extension. On other occasions you may have forgotten part of a file specification. You can use ‘*’ in place of the parts of the specification you have forgotten. Similarly, ‘?’ permits wild-card searches keyed to single characters.
    Example:

    C> dir a:labe?.com
    Lists all five-letter files with the first four letters ‘LABE’ and an extension of ‘COM’.
    C> dir b:format.c??
    Lists all files with a filename of ‘FORMAT’ and an extension beginning with ‘C’.
    Wild-card characters can be used in combination.
    Example:

    C> dir a:labe?.*
    Lists all five-letter files with the first four letters ‘LABE’ and any extension.
    C> dir c:*.ex?
    Lists all files with an extension beginning with ‘EX’.
    Experiment with ‘*’ and ‘?’ to improve your ability to find files quickly. These wild-card characters can also be used with several other DOS commands.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.