Software & Apps Linux List Directory Contents Using the Dir Command List files and folders from within a Linux shell prompt by Gary Newell Writer Gary Newell was a freelance contributor, application developer, and software tester with 20+ years in IT, working on Linux, UNIX, and Windows. our editorial process Gary Newell Updated on September 11, 2020 Linux Switching from Windows Tweet Share Email Although most people who use Linux from a shell prompt traverse the file system using the ls command, Linux also supports a dir command that functions similarly, but with a few key differences. Some distributions do not include dir by default. Get a List of Your Files and Folders Using the Ls Command Similarities Both programs display a listing of files within a directory. Dir is functionally equivalent to the command ls -C -b in which the output lists in columns, sorted vertically, and with backslashed escape sequences to represent special characters. Differences Dir provides output that doesn't vary regardless of whether it displays to a terminal or is piped to a file. Also, given the philosophy of the Gnu Project, dir meets a design-philosophy standard prohibiting the behavior of a command-line program from depending on the type of output device.