In Linux:
ls | xargs -I % mv % %.html
ls
command output is piped to xargs
, and xargs replaces all % (after mv
) with the input from ls
Also, if you want recursively go through all sub-directories, you might want to use:
find . -type f | xargs -I % mv % %.html
And in Windows:
for /r %x in (*) do ren "%x" *.txt