A wildcard like that gets expanded into everything that matches it before the
mv command even runs. Making matters worse is that
*.html will also match your
This means that (for example two files named
def.1.gz.html) your command above is essentially running:
mv abc.1.gz.html def.1.gz.html abc.1.gz.html def.1.gz.html
This will try and move
def.1.gz.html into a directory called
def.1.gz.html. Thankfully this fails as that file is not a directory.
You'll need to script something to look at each file one at a time
for file in *.1.gz.html; do
mv "$file" "`echo $file | sed 's/\.gz\.html$/.html/'`"