-1

This question already has an answer here:

I have multiple files all named

seperate1
seperate2

etc. How do I rename them all to have the extension .csv?

marked as duplicate by Braiam, Ramesh, jimmij, jasonwryan, Michael Homer Feb 6 '15 at 0:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

If there are only files which shall be renamed:

for file in *; do
  mv "$file" "${file}.csv"
done

If there are files with a dot which must be excluded:

for file in *; do
  [[ $file == *.* ]] && continue
  mv "$file" "${file}.csv"
done

Or with shopt -s extglob:

for file in +([^.]); do
  mv "$file" "${file}.csv"
done

Not the answer you're looking for? Browse other questions tagged or ask your own question.