Rekrul
Many years ago, on the Amiga, I recall having a Dir/LS command that had a staggering number of options. You could format the output in pretty much any way you could think of.
I've tried all the options in Dir and I've even downloaded a couple different ports of the Unix LS command, but none of them will do exactly what I want.
Ideally, I'd like it to recursively list all the files in all the sub-directories with the size in bytes listed first, followed by the relative path and filename. Like this;
Code: Select all
49,152 Test1\Stuff.txt
4,096 Test2\Junk.txt
12,121,369 Videos\Demo.mp4
Using;
Code: Select all
for /r %%F in (*.*) do echo %%~zF %%F
With either method, I'm going to have to jump through a ton of hoops to try and reformat the list the way I want it. It would be so much easier if there was a third-party Dir command that let you format the output how you wanted.
Does such a thing exist?
----------------------------
#2 21 Feb 2021 11:06
T3RRY
the dir command has options for sorting and grouping output, and when iterated over from within a for /f loop you can strip the drive letter by just using the ~p modifier.
/A: is the atrribute Switch,subswitch '-D' denotes NOT directory
/S is the recursive switch of the Dir command
/O: is the switch for Sort order, S is the subswitch to sort by size (smallest first), G is the subswitch to group directories while sorting.
From the command line:
Code: Select all
@(For /F "Delims=" %G in ('dir /B /S /A:-D /O:SG')Do @Echo(%~zG %~pG) | @more