I'm renaming empty file extensions with this command:
rename *. *.bla
However, I have a folder with hundreds of such subfolders, and this command requires me to manually navigate to each subfolder and run it.
Is there a command that I can run from just one upper level folder that will include all the files in the subfolders?
Thanks @Wadih M. Find and rename files with no extension?
this will allow you to enter dirs with spaces in the names. (note the double % is for batch files, use a single % for command lines.)
Using find and xargs and basename would make the expression easier to read
Prepare a rename shell script like this (corrected to handle multiple files)
Then you could invoke that to each file matched your criteria, including recursive folder search by find command
A more common sample
Try this
You can use
for
to iterate over subdirectories:When using it from a batch file you would need to double the
%
signs: