rename multiple files in linux 1

rename multiple files in linux

for f in *.html; do
    mv -- "$f" "${f%.html}.php"
done

Here is what the above code is Doing:
1. It’s changing the current directory to the one you want to work in.
2. It’s looping through all the files in the current directory.
3. It’s renaming each file by removing the .html extension and adding .php.

Similar Posts