Dir (command)

From Wikipedia, the free encyclopedia

In computing, dir (directory) is a command used for file and directory listing, specifically in the command line interface (CLI) of these operating systems: RT-11, CP/M, VMS, DOS, OS/2, Singularity, and Microsoft Windows. It is analogous to the Unix ls command.

Because it is the primary means of displaying the files and directories on disk or other storage medium within a command window, the dir command is one of the most basic commands employed by users of the command line interface to MS-DOS and subsequent versions of Microsoft Windows.[1]

The dir command has existed as a DOS command since the initial release of MS-DOS. It is built into the DOS command shell, and is not provided as a separate standalone program.

In DOS and Microsoft Windows, dir checks for switches in the %dircmd% environment variable.

In Windows PowerShell, dir is a predefined command alias for the Get-ChildItem Cmdlet which basically serves the same purpose.

Sample usage

The following example demonstrates the output of the dir command on Windows 7, given no- and one argument(s):

 C:\Users\Public\Pictures\Sample Pictures>dir
  Volume in drive C is System
  Volume Serial Number is C8D0-76E2
 
  Directory of C:\Users\Public\Pictures\Sample Pictures
 
 14-07-2009  06:41    <DIR>          .
 14-07-2009  06:41    <DIR>          ..
 14-07-2009  06:52           879,394 Chrysanthemum.jpg
 14-07-2009  06:52           845,941 Desert.jpg
 14-07-2009  06:52           595,284 Hydrangeas.jpg
 14-07-2009  06:52           775,702 Jellyfish.jpg
 14-07-2009  06:52           780,831 Koala.jpg
 14-07-2009  06:52           561,276 Lighthouse.jpg
 14-07-2009  06:52           777,835 Penguins.jpg
 14-07-2009  06:52           620,888 Tulips.jpg
                8 File(s)      5,837,151 bytes
                2 Dir(s)  57,925,980,160 bytes free
 
 C:\Users\Public\Pictures\Sample Pictures>dir /w
  Volume in drive C is System
  Volume Serial Number is C8D0-76E2
 
  Directory of C:\Users\Public\Pictures\Sample Pictures
 
 [.]                 [..]                Chrysanthemum.jpg   Desert.jpg          Hydrangeas.jpg      Jellyfish.jpg
 Koala.jpg           Lighthouse.jpg      Penguins.jpg        Tulips.jpg
                8 File(s)      5,837,151 bytes
                2 Dir(s)  57,925,992,448 bytes free
 
 C:\Users\Public\Pictures\Sample Pictures>

See also

References

  1. Baril, Suzanne (2000-01-10). "Learning MS-DOS Basics - A Tutorial". Archived from the original on 2007-07-09. Retrieved 2007-08-08. 
This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.