msdos dir cmd vs linux ls
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? I am running a mks unix shell and/or Cgywin Hoping the unix syntax would run faster. Finding over 100,000 + lines |
no, it won't be faster. dir should work better on windows.
The syntax would be something like: ls <cygwin root dir>/cygdrive_d/\!Mp3_A-Z/*.mp3 > target_file |
ls <cygwin root dir>/cygdrive_d/\!Mp3_A-Z/*.mp3 > target_file
Only returns the 8.3 filename format and my dir's also have a "^" in the dirname. I can easily change the carrot. The find cmd reacts the same (8.3) I'm also getting file "*.mp3" not found (There are many subfolders in !Mp3_A-Z) and are not any in the parent folder !Mp3_A-Z) Searching my cobwebs from Xenix in the '80's before the company jumped to "Bill Gates" That was I felt a step backwards but I was only following orders. |
so ls is not really suitable here. That is not a step backward, but mixing windows and linux which is not a good idea (in general).
|
Quote:
Quote:
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). |
All times are GMT -5. The time now is 03:01 PM. |