{"id":479849,"date":"2022-07-31T23:00:00","date_gmt":"2022-07-31T20:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-use-the-dir-command-in-windows\/"},"modified":"2022-07-31T23:00:00","modified_gmt":"2022-07-31T20:00:00","slug":"how-to-use-the-dir-command-in-windows","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/","title":{"rendered":"#How to Use the DIR Command in Windows"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a29a5dbda86e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a29a5dbda86e\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#%E2%80%9CHow_to_Use_the_DIR_Command_in_Windows%E2%80%9D\" >&#8220;How to Use the DIR Command in Windows&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#DIR_Command_Switches\" >DIR Command Switches<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Based_on_File_Attributes\" >Display Based on File Attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Stripped_Results\" >Display Stripped Results<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Using_Thousands_Separator\" >Display Using Thousands Separator<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_in_Columns\" >Display Results in Columns<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_in_Lowercase\" >Display Results in Lowercase<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Filename_Results_on_the_Far_Right\" >Display Filename Results on the Far Right<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_in_Sorted_Order\" >Display Results in Sorted Order<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_One_Page_at_a_Time\" >Display Results One Page at a Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Metadata\" >Display Metadata<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Alternate_Data_Streams_ADS\" >Display Alternate Data Streams (ADS)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_All_Files_and_Folders_and_Everything_Inside\" >Display All Files and Folders and Everything Inside<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_Sorted_by_Time\" >Display Results Sorted by Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Results_in_Wide_Format\" >Display Results in Wide Format<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Short_Name_Filenames\" >Display Short Name Filenames<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#Display_Help_Pages_For_DIR\" >Display Help Pages For DIR<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-dir-command-in-windows\/#DIR_Command_Examples\" >DIR Command Examples<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Use_the_DIR_Command_in_Windows%E2%80%9D\"><\/span>&#8220;How to Use the DIR Command in Windows&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<!-- UNCACHED CONTENT --><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-820362\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/09\/Dir-Command-Prompt-Windows-Blue-Background.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"DIR header. Command Prompt on Windows blue background.\" width=\"1200\" height=\"675\"\/><\/p>\n<p>The DIR command is a powerful Windows Command Prompt function that lists all files and subdirectories contained in a specific directory. The DIR command also offers some switches that unlock some powerful functionality. Let\u2019s take a look.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"DIR_Command_Switches\"><\/span>DIR Command Switches<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can use the <code>DIR<\/code> command by itself (just type \u201cdir\u201d at the Command Prompt) to list the files and folders in the current directory. To extend that functionality, you need to use the various switches, or options, associated with the command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Display_Based_on_File_Attributes\"><\/span>Display Based on File Attributes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can add \u201c\/A\u201d followed by a letter code after the DIR command to display files with a specific attribute. These letter codes include:<\/p>\n<ul>\n<li><strong>D:<\/strong> Displays all directories in the current path<\/li>\n<li><strong>R:<\/strong> Displays read-only files<\/li>\n<li><strong>H:<\/strong> Displays hidden files<\/li>\n<li><strong>A:<\/strong> Files that are ready for archiving<\/li>\n<li><strong>S:<\/strong> System files<\/li>\n<li><strong>I:<\/strong> Not content indexed files<\/li>\n<li><strong>L:<\/strong> Reparse points<\/li>\n<\/ul>\n<p>So, for example, to display just the directories in the current path, you\u2019d type the following command and then hit Enter:<\/p>\n<pre>dir\u00a0\/ad<\/pre>\n<p>You can combine those codes, too. For example, if you wanted to show only system files that are also hidden, you could use the following command:<\/p>\n<pre>dir \/ash<\/pre>\n<p>You also can add a \u201c-\u201d (minus) in front of any of those letter codes to specify that the DIR command does not show that kind of file. So, for example, if you don\u2019t want to see any directories in the results, you could use this command:<\/p>\n<pre>dir \/a-d<\/pre>\n<p>One more tip: Instead of cramming the main switch and the letter code together the way we did in our examples, you can use a colon to separate the switch from its optional codes. Like this:<\/p>\n<pre>dir \/a:d<\/pre>\n<p>It can make things a little easier to parse, but it\u2019s entirely optional.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Display_Stripped_Results\"><\/span>Display Stripped Results<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-365604\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-09-10.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"650\" height=\"168\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Using the <code>\/b<\/code> switch with the DIR command s<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/trip-and-travel\/\" data-internallinksmanager029f6b8e52c=\"10\" title=\"Trip &amp; Travel\" target=\"_blank\" rel=\"noopener\">trip<\/a>s away all excess information, displaying only the name of the folders and files in the current directory and not attributes like file size and time stamps. Type the following command to make it work:<\/p>\n<pre>dir \/b<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Using_Thousands_Separator\"><\/span>Display Using Thousands Separator<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In modern versions of Windows, the Command Prompt shows large numbers separated by commas (so: 25,000 instead of 25000). This wasn\u2019t always the case. In older versions, you had to use the <code>\/c<\/code> switch to show those commas.<\/p>\n<p>Why bother including it here if it\u2019s already the default? Because if for whatever reason you\u00a0<em>don\u2019t<\/em> want to show those commas, you can use this switch along with the \u201c-\u201d minus sign:<\/p>\n<pre>dir \/-c<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_in_Columns\"><\/span>Display Results in Columns<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-365607\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-09-10-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with list of files displayed in columns.\" width=\"650\" height=\"243\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You can use the <code>\/D<\/code> switch to display results in two columns instead of one. When you display results this way, the Command Prompt does not show extra file information (file size and so on)\u2014just the names of the files and directories.<\/p>\n<pre>dir \/D<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_in_Lowercase\"><\/span>Display Results in Lowercase<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <code>\/L<\/code> switch displays all names of files and folders as lowercase.<\/p>\n<pre>dir \/L<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Filename_Results_on_the_Far_Right\"><\/span>Display Filename Results on the Far Right<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-365608\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-09-10-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt running dir \/-N, which lists all files on the left side rather than the right. \" width=\"650\" height=\"256\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>By default, the Command Prompt displays the names of files to the far right. The <code>\/N<\/code> switch used to be used to achieve this effect. Now, you can use it along with a \u201c-\u201d (minus) to have filenames displayed on the far left instead.<\/p>\n<pre>dir\u00a0\/-N<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_in_Sorted_Order\"><\/span>Display Results in Sorted Order<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can use the <code>\/O<\/code>\u00a0switch followed by a letter code to display directory results sorted in various ways. Those letter codes include:<\/p>\n<ul>\n<li><strong>D:<\/strong> Sorts by date\/time. Older entries <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ear first.<\/li>\n<li><strong>E:<\/strong> Sorts by file extension in alphabetical order.<\/li>\n<li><strong>G:<\/strong> Sorts by listing folders first, then files.<\/li>\n<li><strong>N:<\/strong> Sorts by the name of file\/folder in alphabetical order.<\/li>\n<li><strong>S:<\/strong> Sorts by file size, smallest to largest.<\/li>\n<\/ul>\n<p>So, for example, you could use the following command to sort results by time and date, with older entries appearing first:<\/p>\n<pre>dir \/OD<\/pre>\n<p>You can also add \u201c-\u201d (minus) before any of the above options to reverse the order. So, for example, if you want to sort files by time and date with newer entries appearing first, you could use this command:<\/p>\n<pre>dir \/O-D<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_One_Page_at_a_Time\"><\/span>Display Results One Page at a Time<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-365609\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-09-10-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with dir \/P running. It lists files in pages. \" width=\"650\" height=\"198\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Some directories have hundreds or thousands of files. You can use the <code>\/P<\/code> switch to have the Command Prompt pause the results after it displays each screen. You have to press a key to continue viewing the next page of results.<\/p>\n<pre>dir\u00a0\/P<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Metadata\"><\/span>Display Metadata<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-365610\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-09-10-6.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with dir \/Q results. It lists metadata attached to files and folders. \" width=\"650\" height=\"198\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Using the <code>\/Q<\/code> switch on the DIR command displays metadata tied to files and directories, along with ownership details.<\/p>\n<pre>dir\u00a0\/Q<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Alternate_Data_Streams_ADS\"><\/span>Display Alternate Data Streams (ADS)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <code>\/R<\/code> switch displays any alternate data streams (ADS) that files might contain. ADS are a feature of the NTFS file system that let files contain additional metadata for locating files by author and title.<\/p>\n<pre>dir\u00a0\/R<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_All_Files_and_Folders_and_Everything_Inside\"><\/span>Display All Files and Folders and Everything Inside<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can use the <code>\/S<\/code> switch to recursively show all files and folders inside the current directory. This means all files and folders in every subdirectory, all files and folders in those subdirectories, and so on. Be prepared for a\u00a0<em>lot\u00a0<\/em>of results.<\/p>\n<pre>dir\u00a0\/S<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_Sorted_by_Time\"><\/span>Display Results Sorted by Time<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Using the <code>\/T<\/code> switch along with a letter code lets you sort results by the different time stamps associated with files and folders. These letter codes include:<\/p>\n<ul>\n<li><strong>A:<\/strong> The time the item was last accessed.<\/li>\n<li><strong>C:<\/strong> The time the item was created.<\/li>\n<li><strong>W:<\/strong> The time the item was last written to. This is the default option used.<\/li>\n<\/ul>\n<p>So, for example, to sort results by the time items were created, you could use the following command:<\/p>\n<pre>dir \/TC<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Results_in_Wide_Format\"><\/span>Display Results in Wide Format<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <code>\/W<\/code> switch is similar to <code>\/D<\/code> (which shows columns), but instead, it sorts the\u00a0results in wide format horizontally.<\/p>\n<pre>dir\u00a0\/W<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Short_Name_Filenames\"><\/span>Display Short Name Filenames<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <code>\/X<\/code> switch shows a file\u2019s short name when the long name doesn\u2019t comply with 8.3 naming rules.<\/p>\n<pre>dir\u00a0\/X<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Display_Help_Pages_For_DIR\"><\/span>Display Help Pages For DIR<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Using the <code>\/?<\/code> switch displays helpful information regarding the DIR command, including a brief description of all the switches we\u2019ve talked about.<\/p>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-23_15h28_08.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The help page for the dir command. \" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"DIR_Command_Examples\"><\/span>DIR Command Examples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>All right, now you know about the switches and options associated with the DIR command. Let\u2019s take a look at a few real-world examples to gain a better understanding as to how you can start putting them to use.<\/p>\n<p>A simple\u00a0<code>dir<\/code>\u00a0command returns a list of all files and folders in the current directory you\u2019re in.<\/p>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-24_11h26_03.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with dir run in the C:\\ directory. \" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Running the following command\u00a0shows all system files inside your current path by utilizing the \u201cs\u201d attribute:<\/p>\n<pre>dir \/a:s<\/pre>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-24_12h54_12.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command prompt with dir \/a:s run in C:\\ displaying the system files. \" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>But what if you want to view all files of a certain type within all subsequent folders of your current path. That\u2019s easy, just run this extremely fast and useful command:<\/p>\n<pre>dir \\*.mp3 \/s<\/pre>\n<p>You can replace the \u201c.mp3\u201d part with whatever file format you\u2019re looking for.<\/p>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-24_12h01_41.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with dir \\*.mp3 \/s run to display only MP3 files. \" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The asterisk acts as a wildcard, saying \u201cfind anything with .mp3 file format at the end\u201d while the \u201c\/s\u201d recursively looks through all folders within your current path.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>This Command Prompt Trick Searches Way Faster Than Windows Explorer<\/em><\/strong><\/p>\n<p>Now, you may have noticed that returned a LOT of results. Almost too many to be able to read before they scrolled off the screen. This is where we can use the\u00a0pause switch to give you a chance to read them. To do that, modify the command like this:<\/p>\n<pre>dir \\*.mp3 \/s \/p<\/pre>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-24_12h08_30.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Command Prompt with dir \\*.mp3 \/s \/p run to pause the list of MP3 files.\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Another trick the Command Prompt offers is called piping. You can use the \u201c&gt;\u201d character to send the results of one command to another place or service. A good example of this is\u00a0sending all your results to a text file. You can then scroll through them later or import them into other types of documents. To do that, you could use the command:<\/p>\n<pre>dir \\*.mp3 \/s \/b &gt; filename.txt<\/pre>\n<p><img decoding=\"async\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/08\/2018-08-24_12h29_46.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Print or Save a Directory Listing to a File in Windows<\/em><\/strong><\/p>\n<p>We added the <code>\/b<\/code> switch in there to only output the filenames themselves, without any of the other details. The greater than symbol reroutes everything normally displayed in your results directly to the file.<\/p>\n<hr\/>\n<p>There are many more combinations and uses for the DIR command, but this should be a good starting point to help you understand the basics.<\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/363639\/how-to-use-the-dir-command-in-windows\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Use the DIR Command in Windows&#8221; The DIR command is a powerful Windows Command Prompt function that lists all files and subdirectories contained in a specific directory. The DIR command also offers some switches that unlock some powerful functionality. Let\u2019s take a look. DIR Command Switches You can use the DIR command by&#8230;<\/p>\n","protected":false},"author":1,"featured_media":479850,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2018\/09\/Dir-Command-Prompt-Windows-Blue-Background.png?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-479849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/479849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=479849"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/479849\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/479850"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=479849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=479849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=479849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}