I usually use the mv command to rename files. It's pretty straightforward. Just type
mv oldfilename newfilename
1 Answers
If you need to rename multiple files at once, you can use a for loop in a Bash script. I find this method really helpful for batch renaming. For example:
!/bin/bash
for f in .txt; do
mv "$f" "${f%.txt}.pdf"
done
This script changes the extension of all .txt files in the current directory to .pdf.
Please login or Register to submit your answer