Listing Files with PowerShell

I don't want to see all the details!

Posted by Amina Delali on January 19, 2024 · 2 mins read

Used when

I wanted to list the PNG and SVG files I have just created while working on the new design of my other website, but the default command dir will list the files with other details.

So, to run the command, I just clicked on Open in Terminal from the Images folder, and it opened the PowerShell automatically:

opening a folder in a powershell

From the image below, you can see all the extra details added with the names of the existing files:

default dir command in powershell

The Solution

knowing that my Images folder didn’t contain any sub folder, and from a StackOverflow answer available here , I run the following command (and it worked):

dir *.png | % Name

And here is the result:

Original Answer

In the original StackOverflow question, the user wanted to list recursively its TXT files from the command prompt without listing the parent folders. And the following answer was given to him:

  • PowerShell Command
 dir *.txt -r | % Name
  • CMD Command
 PowerShell -Command "dir *.txt -r | % Name"