Dir: learn how to use one of the most useful CMD commands in Windows

0
13

By simply opening a command prompt window in Windows we can start working through the many commands that we have at our disposal. Dir is one of the most important and common, so we are going to show you a good part of its secrets.

At first, the main objective of this important command is quite simple and easy to understand. We just have to run Dir in the command prompt window to list all the files and folders in the current directory. In addition, as in many other commands, this command also accepts special arguments to carry out different tasks, as we will see.

Despite the simplicity of this command that we execute in the Windows command prompt window, it is a much more powerful command than we might think at first. This is precisely what we want to talk to you about below in order to know the secrets of Dir and be able to get the most out of it.

Dir works in both CMD and PowerShell, so we can use it regardless of the command console we are using. Of course, we must keep in mind that this command is exclusive to Windows (since it is inherited from MS-DOS), so if we use Linux, or macOS, we will have to use the equivalent to list all the files in a directory: ls .

Most important functions of the Dir command in Windows

There are many variants that Dir offers us using the available parameters proposed by the Microsoft operating system. Below we are going to show you some of the most useful ways of using it with its different parameters and variables.

  • Dir: by simply typing the command itself, a list of the files and folders in the current directory is displayed on the screen.
  • Dir /AD: Shows all directories in the current path.
  • Dir /AR: for read-only files.
  • Dir /AH: shows hidden files in the path.
  • Dir /AS: shows us the system files.
  • Dir /AI: used to see those not indexed by content.
  • Dir /B: eliminates all excess information that will appear on the screen. This way it only shows the name of the folders and files in the current directory, without additional attributes.
  • Dir /D: organizes the results displayed on the screen in two columns to make them more comfortable to understand and read.
  • Dir /L: Displays all file and folder names in lowercase.
  • Dir /OD: Sorts output files and folders by date and time. The oldest content appears first.
  • Dir /OE: we will see the contents shown in the list ordered alphabetically depending on its extension.
  • Dir /OG: in this way the command places the folders contained in the current path first.
  • Dir /ON: with this parameter we can sort the list alphabetically based on its name.
  • Dir /OS: so we can sort the files by size, from smallest to largest.
  • Dir /P: if the list is too long, the command will pause so that we can see the contents in a much more comfortable way on the screen.
  • Dir /Q: Displays metadata linked to files and folders along with property details.

These are some of the most important parameters that we can use together with this powerful command, which will allow us to obtain personalized lists of the files and folders stored on our hard drive.

Previous articleWhen ChatGPT is telling lies about you: new complaint against OpenAI’s AI
Next articleThe best last minute deals for Mother’s Day

LEAVE A REPLY

Please enter your comment!
Please enter your name here