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:
From the image below, you can see all the extra details added with the names of the existing files:
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:
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:
dir *.txt -r | % Name
PowerShell -Command "dir *.txt -r | % Name"