dir (command line command)

from Wikipedia, the free encyclopedia
A simple output of the dircommand

dir is a command line command that outputs the contents of directories ( dir ectories ) on a storage medium . Among other things, it is used in the DOS , Windows , OS / 2 , RT-11 , CP / M , VMS or Singularity operating systems . Due to its importance for finding one's way around a command line at all, it is one of the best known of all, along with cd .

MS-DOS and Windows

DIR- usually case-insensitive in MS-DOS and Windows - was included in Tim Paterson's 86-DOS and is one of the seven command line commands that have been available since the first edition of MS-DOS .

parameter

All parameters are optional, which means that a simple input of is DIRsufficient to issue the command. In this case, default values ​​are automatically used for the parameters. It is also possible to define standard values ​​for the dir parameters yourself via the environment variable %dircmd% , which are then automatically appended each time the command is used.

The following parameters are currently supported by the dir command:

parameter meaning
/ A Lists elements with corresponding attributes

/ AA = about a rchivierende files
/ AD = directories
/ AH = hidden files (English h Idden )
/ AI = not i ndizierte files
/ AL = analysis points (English also generally l eft )
/ AS = S ystemdateien
/ AR = read-only files ( English , r ead only ' )

with " - " prefix parameters are interpreted in their opposite meaning (eg. / AH does not list hidden files).

/ B Lists only the files and directories, without a heading or summary
/ C Sets a thousands separator for the file size
/ D Output as a multi-column list, sorted by column
/ L Output in lower case
/ N "New long-list" format. Displays the file names right-aligned.
/O Output is sorted according to the criterion:

/ OD = after D ate
/ OE = after file e NLARGEMENT
/ OG = g ruppiert directories first
/ ON = to N ame
/ OS = the size (English s ize )

with " - " prefixed parameters are interpreted in their opposite importance (e.g. B. / ON lists files and folders in reverse alphabetical order).

/ P Displays the output page by page.
/ Q Shows the owner of a file
/ R Shows alternative data stream of a file.
/ S Shows all subdirectories as well as the current directory.
/ T Defines which time information is to be output ( Windows NT only )

/ TC = time of creation of a file or folder
/ TA = time of the last access to a file or folder
/ TW = time of the last processing of a file or folder

/ W Output as a multi-column list, sorted by series
/ X Displays the short name of a file, if available (Windows NT only).
/ 4 Displays the year in four digits (e.g. 1994 instead of 94 )

Other command line interpreters

The DIRcommand was in CP / M available. The dir command also exists under Powershell as a command alias that refers to the Get-ChildItem command . On Unix / Linux , the command ls is used instead of dir to output files and directories.

Individual evidence

  1. MS-DOS top 10 commands (English) - Computer Hope ; 2016
  2. DOS 1.0 and 1.1 (English) - OS / 2 Museum ; 2014
  3. Using the Get-ChildItem cmdlet. Microsoft Technet ; Retrieved on June 19, 2013.