![]() ![]() ![]() , so - is not necessary but apparently not all implementations do this. (like in this case) many implementations of find will print paths starting with. I used a double dash in case there's a file with name beginning with - that could be interpreted as an option.Therefore the two versions (with + and with ) may differ in formatting their outputs. On the other hand file that processes multiple arguments may columnize its output, so it looks "better". With + file can get multiple operands ( find is still able to call file multiple times if there are too many files to build a single command). type f -exec file - \ would also work, but then a separate file would be invoked for every file found. In the above approach such path will get to file in two or more lines and the tool will treat each line as a separate path to examine.Ī robust and portable way: find. ![]() The problem is with paths that contain newlines they are still valid in Unix (yet uncommon). Then file -f - expects one path per line. Is there a way to do this from the command. Looking at the del and rmdir DOS command, it does not look like you can recursively do this without deleting all the files. I want to delete all the empty directories. The script I used was as below: for f in ('dp0.dwg') do accoreconsole.exe /i 'f' /s 'C:\Users\MiralKong\Desktop\TEST\ExtendDataTest. I'm using a bat file to process a large amount of files. find prints each path with a trailing newline character, so it's usually one path (file) per line. I have a directory on my Windows 7 machine that has hundreds if not thousands of sub-directories. How to search file recursively in for do loop in a bat file Fanhua Kong 241 Apr 22, 2023, 6:56 PM Hi guys.-f option is not required by POSIX, some implementations of file may not support it.The other answer provides not the best way: find. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |