Lably
Skip to content

Dir (command)

Shell command for listing files and directories

  • 3 min read
  • 2 chapters

Related on Lably

Through Command (computing), File system and Operating system

The command is often implemented as internal in the operating system shell instead of as a separate application as many other commands are.

Variants

Although syntax, semantics and implementations vary, a dir command with essentially the same functionality is available in the operating systems: CP/M, MP/M, ISIS-II, iRMX 86, CDOS, TRIPOS, DOS, 4690 OS, OS/2, Windows, Singularity, ROM-DOS, ReactOS, GNU, AROS, VMS, RT-11, RSX-11, OS/8, 86-DOS, MS-DOS (in versions 1 and later), and DOSBox.

Some applications also provide a dir command with similar functionality. The typical File Transfer Protocol (FTP) command-line client provides a dir command for listing a remote directory. The numerical computing environments MATLAB and GNU Octave include a dir command.

Generally, Unix-like systems use the ls command for the needs that dir satisfies in other types of systems. Notably, the Unix-like GNU operating system, provides a dir command that is equivalent to ls -C -b; that is, by default files are listed in columns, sorted vertically, and special characters are represented by backslash escape sequences.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication