I was trying to rename some files to another extension:
# mv *.sqlite3_done *.sqlite3
but got an error:
mv: target '*.sqlite3' is not a directory
Why?
You can use the built-in Linux command mv to rename files. Here are some of the options that can come in handy with the mv command: -v , --verbose : Explains what is being done. -i , --interactive : Prompts before renaming the file.
mv
can only move multiple files into a single directory; it can’t move each one to a different name. You can loop in bash instead:
for x in *.sqlite3_done; do
mv "$x" "${x%_done}"
done
${x%_done}
removes _done
from the end of $x
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With