Imagine you have some logfiles with .txt extensions and you want them all to be .log files.
You just need to type this within the logfile directory:
for file in *.txt; do mv $file ${file%.txt}.log; done
There many situations where renaming many files very easly is interessting.
Remember to use "in *.txt". Otherwise spaces could be problematic.
ReplyDelete