dir, short for directory, is a shellcommand for listing file system contents; files and directories.[1] Arguably, the command provides the same essential functionality as the ls command, but typically the two commands are described as notably separate concepts, possibly since ls is implemented from a codebase that shares more history than many dir implementations.
The command is often implemented as internal in the operating systemshell instead of as a separate application as many other commands are.
Recursively list all files and directories in the specified directory and any subdirectories, in wide format, pausing after each screen of output. The directory name is enclosed in double-quotes, to prevent it from being interpreted is as two separate command-line options because it contains a whitespace character.
C:\Users>dir /ashVolume in drive C is OS.Volume Serial Number is xxxx-xxxxDirectory of C:\Users12/07/2019 02:30 AM <SYMLINKD> All Users [C:\ProgramData]12/07/2019 02:30 AM <JUNCTION> Default User [C:\Users\Default]12/07/2019 02:12 AM 174 desktop.ini1 File(s) 174 bytes2 Dir(s) 332,659,789,824 bytes free
Unix
Traditionally, Unix and Unix-like systems use the ls command for the needs that dir satisfies. But, the GNU operating system, has 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".[19] Actually, for compatibility reasons, ls produces device-dependent output. The dir command, on the other hand, produces device-independent output.