Quote:
Originally Posted by Gebby_3
Windows 10 cmd prompt syntax:
dir /b /s d:\!Mp3_A-Z\*.mp3 > d:\!mp3list\filename.lst
What would be the unix equivalent using possibly ls?
|
As per "
dir /?":
Quote:
/B Uses bare format (no heading information or summary).
/S Displays files in specified directory and all subdirectories.
|
So "
/B" is a single filename per line, which is achieved with "
-1" for ls.
And "
/S" is a recursive listing which is achieved with "
-R" for ls.
If you do "
ls /path/*.ext" you'll get the path prefixed to filenames.
To avoid that you should do "
cd /path/; ls*.txt; cd -" or "
pushd /path/; ls*.txt; popd"
As I mentioned in your other thread: ditch
MKS Toolkit and just use
MinGW (either via
MSys2 or
Git) then you can use a standard Bash shell & other GNU tools, which makes it easier for anything you write to be cross-platform.
I can confirm neither Git Bash nor MSys Bash will give you 8.3 filenames. (They also allow you to simply write "/d/directory/" and/or drag files into the terminal to have the full path populated).