Forrest logo
back to the dir tool

dir:tldr:73600

dir: Show the contents of the current directory.
$ dir
try on your machine

The "dir" command is a command used in a command-line interface (CLI) to display a list of files and directories within a specified directory.

When you execute the "dir" command, it will display a list of all the files and directories in the current directory by default. Each entry in the list typically includes the name of the file or directory, its size, and the date and time it was last modified.

The "dir" command also accepts several optional parameters that can modify its behavior. Some common parameters include:

  • "/p" or "/w": These parameters control the display format of the list. "/p" causes the list to be displayed one screen at a time, while "/w" displays the list in wide format with only the file/directory names.

  • "/s": This parameter causes the command to display a recursive list, showing all the files and directories within the specified directory and its subdirectories.

  • "/a": This parameter is used to display hidden files and directories that are normally not shown in the list.

  • "/b": This parameter displays a bare format list, listing only the names of the files and directories without any additional information.

It is worth noting that while the "dir" command is most commonly associated with Windows operating systems, similar commands with slightly different syntax exist in other operating systems like Linux and macOS (e.g., "ls" in Linux).

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the dir tool